mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 21:14:35 -07:00
feat(core): Preliminary changes for subagent model routing. (#16035)
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
resolveModel,
|
||||
resolveClassifierModel,
|
||||
isGemini2Model,
|
||||
isAutoModel,
|
||||
getDisplayString,
|
||||
DEFAULT_GEMINI_MODEL,
|
||||
PREVIEW_GEMINI_MODEL,
|
||||
@@ -18,6 +19,7 @@ import {
|
||||
GEMINI_MODEL_ALIAS_PRO,
|
||||
GEMINI_MODEL_ALIAS_FLASH,
|
||||
GEMINI_MODEL_ALIAS_FLASH_LITE,
|
||||
GEMINI_MODEL_ALIAS_AUTO,
|
||||
PREVIEW_GEMINI_FLASH_MODEL,
|
||||
PREVIEW_GEMINI_MODEL_AUTO,
|
||||
DEFAULT_GEMINI_MODEL_AUTO,
|
||||
@@ -171,6 +173,26 @@ describe('isGemini2Model', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isAutoModel', () => {
|
||||
it('should return true for "auto"', () => {
|
||||
expect(isAutoModel(GEMINI_MODEL_ALIAS_AUTO)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for "auto-gemini-3"', () => {
|
||||
expect(isAutoModel(PREVIEW_GEMINI_MODEL_AUTO)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for "auto-gemini-2.5"', () => {
|
||||
expect(isAutoModel(DEFAULT_GEMINI_MODEL_AUTO)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for concrete models', () => {
|
||||
expect(isAutoModel(DEFAULT_GEMINI_MODEL)).toBe(false);
|
||||
expect(isAutoModel(PREVIEW_GEMINI_MODEL)).toBe(false);
|
||||
expect(isAutoModel('some-random-model')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveClassifierModel', () => {
|
||||
it('should return flash model when alias is flash', () => {
|
||||
expect(
|
||||
|
||||
@@ -146,6 +146,20 @@ export function isGemini2Model(model: string): boolean {
|
||||
return /^gemini-2(\.|$)/.test(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the model is an auto model.
|
||||
*
|
||||
* @param model The model name to check.
|
||||
* @returns True if the model is an auto model.
|
||||
*/
|
||||
export function isAutoModel(model: string): boolean {
|
||||
return (
|
||||
model === GEMINI_MODEL_ALIAS_AUTO ||
|
||||
model === PREVIEW_GEMINI_MODEL_AUTO ||
|
||||
model === DEFAULT_GEMINI_MODEL_AUTO
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the model supports multimodal function responses (multimodal data nested within function response).
|
||||
* This is supported in Gemini 3.
|
||||
|
||||
Reference in New Issue
Block a user