mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-11 06:31:01 -07:00
feat(zed-integration): Use default model routing for Zed integration (#13398)
Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
This commit is contained in:
@@ -27,11 +27,9 @@ import {
|
||||
DiscoveredMCPTool,
|
||||
StreamEventType,
|
||||
ToolCallEvent,
|
||||
DEFAULT_GEMINI_MODEL,
|
||||
DEFAULT_GEMINI_MODEL_AUTO,
|
||||
DEFAULT_GEMINI_FLASH_MODEL,
|
||||
debugLogger,
|
||||
ReadManyFilesTool,
|
||||
getEffectiveModel,
|
||||
} from '@google/gemini-cli-core';
|
||||
import * as acp from './acp.js';
|
||||
import { AcpFileSystemService } from './fileSystemService.js';
|
||||
@@ -47,19 +45,6 @@ import { randomUUID } from 'node:crypto';
|
||||
import type { CliArgs } from '../config/config.js';
|
||||
import { loadCliConfig } from '../config/config.js';
|
||||
|
||||
/**
|
||||
* Resolves the model to use based on the current configuration.
|
||||
*
|
||||
* If the model is set to "auto", it will use the flash model if in fallback
|
||||
* mode, otherwise it will use the default model.
|
||||
*/
|
||||
export function resolveModel(model: string, isInFallbackMode: boolean): string {
|
||||
if (model === DEFAULT_GEMINI_MODEL_AUTO) {
|
||||
return isInFallbackMode ? DEFAULT_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_MODEL;
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
export async function runZedIntegration(
|
||||
config: Config,
|
||||
settings: LoadedSettings,
|
||||
@@ -264,9 +249,10 @@ class Session {
|
||||
const functionCalls: FunctionCall[] = [];
|
||||
|
||||
try {
|
||||
const model = resolveModel(
|
||||
this.config.getModel(),
|
||||
const model = getEffectiveModel(
|
||||
this.config.isInFallbackMode(),
|
||||
this.config.getModel(),
|
||||
this.config.getPreviewFeatures(),
|
||||
);
|
||||
const responseStream = await chat.sendMessageStream(
|
||||
{ model },
|
||||
|
||||
Reference in New Issue
Block a user