mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-20 18:14:29 -07:00
Fix tool output fragmentation by encapsulating content in functionResponse (#13082)
This commit is contained in:
@@ -14,8 +14,25 @@ import {
|
||||
GEMINI_MODEL_ALIAS_PRO,
|
||||
GEMINI_MODEL_ALIAS_FLASH,
|
||||
GEMINI_MODEL_ALIAS_FLASH_LITE,
|
||||
supportsMultimodalFunctionResponse,
|
||||
} from './models.js';
|
||||
|
||||
describe('supportsMultimodalFunctionResponse', () => {
|
||||
it('should return true for gemini-3 model', () => {
|
||||
expect(supportsMultimodalFunctionResponse('gemini-3-pro')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for gemini-2 models', () => {
|
||||
expect(supportsMultimodalFunctionResponse('gemini-2.5-pro')).toBe(false);
|
||||
expect(supportsMultimodalFunctionResponse('gemini-2.5-flash')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for other models', () => {
|
||||
expect(supportsMultimodalFunctionResponse('some-other-model')).toBe(false);
|
||||
expect(supportsMultimodalFunctionResponse('')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getEffectiveModel', () => {
|
||||
describe('When NOT in fallback mode', () => {
|
||||
const isInFallbackMode = false;
|
||||
|
||||
@@ -99,8 +99,19 @@ export function getEffectiveModel(
|
||||
* Checks if the model is a Gemini 2.x model.
|
||||
*
|
||||
* @param model The model name to check.
|
||||
* @returns True if the model is a Gemini 2.x model.
|
||||
* @returns True if the model is a Gemini-2.x model.
|
||||
*/
|
||||
export function isGemini2Model(model: string): boolean {
|
||||
return /^gemini-2(\.|$)/.test(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the model supports multimodal function responses (multimodal data nested within function response).
|
||||
* This is supported in Gemini 3.
|
||||
*
|
||||
* @param model The model name to check.
|
||||
* @returns True if the model supports multimodal function responses.
|
||||
*/
|
||||
export function supportsMultimodalFunctionResponse(model: string): boolean {
|
||||
return model.startsWith('gemini-3-');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user