diff options
Diffstat (limited to 'packages/cli/src/core/gemini-client.ts')
| -rw-r--r-- | packages/cli/src/core/gemini-client.ts | 18 |
1 files changed, 8 insertions, 10 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; |
