refactor: remove unnecessary "await" (#2574)
This commit is contained in:
parent
9ae2595bfd
commit
19a0276142
|
@ -339,7 +339,7 @@ describe('Gemini Client (client.ts)', () => {
|
||||||
describe('resetChat', () => {
|
describe('resetChat', () => {
|
||||||
it('should create a new chat session, clearing the old history', async () => {
|
it('should create a new chat session, clearing the old history', async () => {
|
||||||
// 1. Get the initial chat instance and add some history.
|
// 1. Get the initial chat instance and add some history.
|
||||||
const initialChat = await client.getChat();
|
const initialChat = client.getChat();
|
||||||
const initialHistory = await client.getHistory();
|
const initialHistory = await client.getHistory();
|
||||||
await client.addHistory({
|
await client.addHistory({
|
||||||
role: 'user',
|
role: 'user',
|
||||||
|
@ -354,7 +354,7 @@ describe('Gemini Client (client.ts)', () => {
|
||||||
await client.resetChat();
|
await client.resetChat();
|
||||||
|
|
||||||
// 3. Get the new chat instance and its history.
|
// 3. Get the new chat instance and its history.
|
||||||
const newChat = await client.getChat();
|
const newChat = client.getChat();
|
||||||
const newHistory = await client.getHistory();
|
const newHistory = await client.getHistory();
|
||||||
|
|
||||||
// 4. Assert that the chat instance is new and the history is reset.
|
// 4. Assert that the chat instance is new and the history is reset.
|
||||||
|
|
|
@ -100,7 +100,6 @@ export class GeminiClient {
|
||||||
|
|
||||||
async resetChat(): Promise<void> {
|
async resetChat(): Promise<void> {
|
||||||
this.chat = await this.startChat();
|
this.chat = await this.startChat();
|
||||||
await this.chat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getEnvironment(): Promise<Part[]> {
|
private async getEnvironment(): Promise<Part[]> {
|
||||||
|
|
Loading…
Reference in New Issue