mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-11 02:20:48 -07:00
feat(cli): merge Auto modes into a single Auto mode (#26714)
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
PREVIEW_GEMINI_3_1_MODEL,
|
||||
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
|
||||
isProModel,
|
||||
getAutoModelDescription,
|
||||
} from '../config/models.js';
|
||||
|
||||
// The primary key for the ModelConfig is the model string. However, we also
|
||||
@@ -101,6 +102,7 @@ export interface ResolutionContext {
|
||||
hasAccessToPreview?: boolean;
|
||||
hasAccessToProModel?: boolean;
|
||||
requestedModel?: string;
|
||||
releaseChannel?: string;
|
||||
}
|
||||
|
||||
/** The requirements defined in the registry. */
|
||||
@@ -111,6 +113,7 @@ export interface ResolutionCondition {
|
||||
hasAccessToPreview?: boolean;
|
||||
/** Matches if the current model is in this list. */
|
||||
requestedModels?: string[];
|
||||
releaseChannel?: string;
|
||||
}
|
||||
|
||||
export interface ModelConfigServiceConfig {
|
||||
@@ -156,6 +159,7 @@ export class ModelConfigService {
|
||||
const shouldShowPreviewModels = context.hasAccessToPreview ?? false;
|
||||
const useGemini31 = context.useGemini3_1 ?? false;
|
||||
const useGemini31FlashLite = context.useGemini3_1FlashLite ?? false;
|
||||
const releaseChannel = context.releaseChannel ?? 'stable';
|
||||
|
||||
const mainOptions = Object.entries(definitions)
|
||||
.filter(([_, m]) => {
|
||||
@@ -164,18 +168,21 @@ export class ModelConfigService {
|
||||
if (m.tier !== 'auto') return false;
|
||||
return true;
|
||||
})
|
||||
.map(([id, m]) => ({
|
||||
modelId: id,
|
||||
name: m.displayName ?? getDisplayString(id),
|
||||
description:
|
||||
id === 'auto-gemini-3' && useGemini31
|
||||
? (m.dialogDescription ?? '').replace(
|
||||
'gemini-3-pro',
|
||||
'gemini-3.1-pro',
|
||||
)
|
||||
: (m.dialogDescription ?? ''),
|
||||
tier: m.tier ?? 'auto',
|
||||
}));
|
||||
.map(([id, m]) => {
|
||||
let description = m.dialogDescription ?? '';
|
||||
if (id === 'auto') {
|
||||
description = getAutoModelDescription(releaseChannel, useGemini31);
|
||||
} else if (id === 'auto-gemini-3' && useGemini31) {
|
||||
description = description.replace('gemini-3-pro', 'gemini-3.1-pro');
|
||||
}
|
||||
|
||||
return {
|
||||
modelId: id,
|
||||
name: m.displayName ?? getDisplayString(id),
|
||||
description,
|
||||
tier: m.tier ?? 'auto',
|
||||
};
|
||||
});
|
||||
|
||||
const manualOptions = Object.entries(definitions)
|
||||
.filter(([id, m]) => {
|
||||
@@ -258,6 +265,8 @@ export class ModelConfigService {
|
||||
!!context.requestedModel &&
|
||||
value.includes(context.requestedModel)
|
||||
);
|
||||
case 'releaseChannel':
|
||||
return value === context.releaseChannel;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user