diff options
Diffstat (limited to 'packages/cli/src/core')
| -rw-r--r-- | packages/cli/src/core/gemini-client.ts | 18 | ||||
| -rw-r--r-- | packages/cli/src/core/gemini-stream.ts | 3 | ||||
| -rw-r--r-- | packages/cli/src/core/history-updater.ts | 2 |
3 files changed, 10 insertions, 13 deletions
diff --git a/packages/cli/src/core/gemini-client.ts b/packages/cli/src/core/gemini-client.ts index c7c7b5f6..0b79a2ad 100644 --- a/packages/cli/src/core/gemini-client.ts +++ b/packages/cli/src/core/gemini-client.ts @@ -44,7 +44,7 @@ export class GeminiClient { this.ai = new GoogleGenAI({ apiKey }); } - public async startChat(): Promise<Chat> { + async startChat(): Promise<Chat> { const tools = toolRegistry.getToolSchemas(); const model = getModel(); @@ -75,7 +75,7 @@ ${folderStructure} try { const chat = this.ai.chats.create({ - model: model, + model, config: { systemInstruction: CoreSystemPrompt, ...this.defaultHyperParameters, @@ -103,14 +103,12 @@ ${folderStructure} } } - public addMessageToHistory(chat: Chat, message: Content): void { + addMessageToHistory(chat: Chat, message: Content): void { const history = chat.getHistory(); history.push(message); - this.ai.chats; - chat; } - public async *sendMessageStream( + async *sendMessageStream( chat: Chat, request: PartListUnion, signal?: AbortSignal, @@ -180,7 +178,7 @@ ${folderStructure} } if (pendingToolCalls.length > 0) { - const toolPromises: Promise<ToolExecutionOutcome>[] = + const toolPromises: Array<Promise<ToolExecutionOutcome>> = pendingToolCalls.map(async (pendingToolCall) => { const tool = toolRegistry.getTool(pendingToolCall.name); @@ -311,7 +309,7 @@ ${folderStructure} return { functionResponse: { - name: name, + name, id: executedTool.callId, response: toolOutcomePayload, }, @@ -444,7 +442,7 @@ Respond *only* in JSON format according to the following schema. Do not include * @returns A promise that resolves to the parsed JSON object matching the schema. * @throws Throws an error if the API call fails or the response is not valid JSON. */ - public async generateJson( + async generateJson( contents: Content[], schema: SchemaUnion, ): Promise<any> { @@ -458,7 +456,7 @@ Respond *only* in JSON format according to the following schema. Do not include responseSchema: schema, responseMimeType: 'application/json', }, - contents: contents, // Pass the full Content array + contents, // Pass the full Content array }); const responseText = result.text; diff --git a/packages/cli/src/core/gemini-stream.ts b/packages/cli/src/core/gemini-stream.ts index 065d261a..314a829d 100644 --- a/packages/cli/src/core/gemini-stream.ts +++ b/packages/cli/src/core/gemini-stream.ts @@ -1,6 +1,5 @@ -import { ToolCallEvent } from '../ui/types.js'; +import { ToolCallEvent , HistoryItem } from '../ui/types.js'; import { Part } from '@google/genai'; -import { HistoryItem } from '../ui/types.js'; import { handleToolCallChunk, addErrorMessageToHistory, diff --git a/packages/cli/src/core/history-updater.ts b/packages/cli/src/core/history-updater.ts index 12dd30c0..a97c99a1 100644 --- a/packages/cli/src/core/history-updater.ts +++ b/packages/cli/src/core/history-updater.ts @@ -118,7 +118,7 @@ export const handleToolCallChunk = ( description, resultDisplay: chunk.resultDisplay, status: chunk.status, - confirmationDetails: confirmationDetails, + confirmationDetails, }; const activeGroupId = currentToolGroupIdRef.current; |
