diff options
| author | Taylor Mullen <[email protected]> | 2025-05-26 14:17:56 -0700 |
|---|---|---|
| committer | N. Taylor Mullen <[email protected]> | 2025-05-26 14:20:28 -0700 |
| commit | 480549e02ed4ae01c7df2abbd98bb0eb5b23bdd5 (patch) | |
| tree | 9eae14b1d3e498a78b5809154189bfcc93de6274 /packages/server/src/core/turn.test.ts | |
| parent | 02503a3248d377e13dda5cf8ad5fc39cce365811 (diff) | |
Refactor(chat): Introduce custom Chat class for future modifications
- Copied the `Chat` class from `@google/genai` into `packages/server/src/core/geminiChat.ts`.
- This change is in preparation for future modifications to the chat handling logic.
- Updated relevant files to use the new `GeminiChat` class.
Part of https://github.com/google-gemini/gemini-cli/issues/551
Diffstat (limited to 'packages/server/src/core/turn.test.ts')
| -rw-r--r-- | packages/server/src/core/turn.test.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/server/src/core/turn.test.ts b/packages/server/src/core/turn.test.ts index 90d3407f..44bb983f 100644 --- a/packages/server/src/core/turn.test.ts +++ b/packages/server/src/core/turn.test.ts @@ -11,8 +11,9 @@ import { ServerGeminiToolCallRequestEvent, ServerGeminiErrorEvent, } from './turn.js'; -import { Chat, GenerateContentResponse, Part, Content } from '@google/genai'; +import { GenerateContentResponse, Part, Content } from '@google/genai'; import { reportError } from '../utils/errorReporting.js'; +import { GeminiChat } from './geminiChat.js'; const mockSendMessageStream = vi.fn(); const mockGetHistory = vi.fn(); @@ -54,7 +55,7 @@ describe('Turn', () => { sendMessageStream: mockSendMessageStream, getHistory: mockGetHistory, }; - turn = new Turn(mockChatInstance as unknown as Chat); + turn = new Turn(mockChatInstance as unknown as GeminiChat); mockGetHistory.mockReturnValue([]); mockSendMessageStream.mockResolvedValue((async function* () {})()); }); |
