From cb303514035440b1631964cad5093a4c80cd3e43 Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Fri, 18 Apr 2025 17:06:16 +0100 Subject: Adding a new parameter for model, and updating the default to 2.5 Flash. (#18) --- packages/cli/src/core/gemini-client.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packages/cli/src/core') diff --git a/packages/cli/src/core/gemini-client.ts b/packages/cli/src/core/gemini-client.ts index 41cabdb7..c7c7b5f6 100644 --- a/packages/cli/src/core/gemini-client.ts +++ b/packages/cli/src/core/gemini-client.ts @@ -9,6 +9,7 @@ import { Content, } from '@google/genai'; import { getApiKey } from '../config/env.js'; +import { getModel } from '../config/globalConfig.js'; import { CoreSystemPrompt } from './prompts.js'; import { type ToolCallEvent, @@ -45,6 +46,7 @@ export class GeminiClient { public async startChat(): Promise { const tools = toolRegistry.getToolSchemas(); + const model = getModel(); // --- Get environmental information --- const cwd = process.cwd(); @@ -73,7 +75,7 @@ ${folderStructure} try { const chat = this.ai.chats.create({ - model: 'gemini-2.0-flash', //'gemini-2.0-flash', + model: model, config: { systemInstruction: CoreSystemPrompt, ...this.defaultHyperParameters, @@ -446,9 +448,10 @@ Respond *only* in JSON format according to the following schema. Do not include contents: Content[], schema: SchemaUnion, ): Promise { + const model = getModel(); try { const result = await this.ai.models.generateContent({ - model: 'gemini-2.0-flash', // Using flash for potentially faster structured output + model: model, config: { ...this.defaultHyperParameters, systemInstruction: CoreSystemPrompt, -- cgit v1.2.3