mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 12:34:38 -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,
|
DiscoveredMCPTool,
|
||||||
StreamEventType,
|
StreamEventType,
|
||||||
ToolCallEvent,
|
ToolCallEvent,
|
||||||
DEFAULT_GEMINI_MODEL,
|
|
||||||
DEFAULT_GEMINI_MODEL_AUTO,
|
|
||||||
DEFAULT_GEMINI_FLASH_MODEL,
|
|
||||||
debugLogger,
|
debugLogger,
|
||||||
ReadManyFilesTool,
|
ReadManyFilesTool,
|
||||||
|
getEffectiveModel,
|
||||||
} from '@google/gemini-cli-core';
|
} from '@google/gemini-cli-core';
|
||||||
import * as acp from './acp.js';
|
import * as acp from './acp.js';
|
||||||
import { AcpFileSystemService } from './fileSystemService.js';
|
import { AcpFileSystemService } from './fileSystemService.js';
|
||||||
@@ -47,19 +45,6 @@ import { randomUUID } from 'node:crypto';
|
|||||||
import type { CliArgs } from '../config/config.js';
|
import type { CliArgs } from '../config/config.js';
|
||||||
import { loadCliConfig } 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(
|
export async function runZedIntegration(
|
||||||
config: Config,
|
config: Config,
|
||||||
settings: LoadedSettings,
|
settings: LoadedSettings,
|
||||||
@@ -264,9 +249,10 @@ class Session {
|
|||||||
const functionCalls: FunctionCall[] = [];
|
const functionCalls: FunctionCall[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const model = resolveModel(
|
const model = getEffectiveModel(
|
||||||
this.config.getModel(),
|
|
||||||
this.config.isInFallbackMode(),
|
this.config.isInFallbackMode(),
|
||||||
|
this.config.getModel(),
|
||||||
|
this.config.getPreviewFeatures(),
|
||||||
);
|
);
|
||||||
const responseStream = await chat.sendMessageStream(
|
const responseStream = await chat.sendMessageStream(
|
||||||
{ model },
|
{ model },
|
||||||
|
|||||||
Reference in New Issue
Block a user