mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 10:34:35 -07:00
feat: update thinking mode support to exclude gemini-2.0 models and simplify logic. (#13454)
This commit is contained in:
@@ -137,6 +137,7 @@ async function fromAsync<T>(promise: AsyncGenerator<T>): Promise<readonly T[]> {
|
|||||||
describe('isThinkingSupported', () => {
|
describe('isThinkingSupported', () => {
|
||||||
it('should return true for gemini-2.5', () => {
|
it('should return true for gemini-2.5', () => {
|
||||||
expect(isThinkingSupported('gemini-2.5')).toBe(true);
|
expect(isThinkingSupported('gemini-2.5')).toBe(true);
|
||||||
|
expect(isThinkingSupported('gemini-2.5-flash')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true for gemini-2.5-pro', () => {
|
it('should return true for gemini-2.5-pro', () => {
|
||||||
@@ -147,9 +148,13 @@ describe('isThinkingSupported', () => {
|
|||||||
expect(isThinkingSupported('gemini-3-pro')).toBe(true);
|
expect(isThinkingSupported('gemini-3-pro')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false for other models', () => {
|
it('should return false for gemini-2.0 models', () => {
|
||||||
expect(isThinkingSupported('gemini-1.5-flash')).toBe(false);
|
expect(isThinkingSupported('gemini-2.0-flash')).toBe(false);
|
||||||
expect(isThinkingSupported('some-other-model')).toBe(false);
|
expect(isThinkingSupported('gemini-2.0-pro')).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true for other models', () => {
|
||||||
|
expect(isThinkingSupported('some-other-model')).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import type {
|
|||||||
import type { ContentGenerator } from './contentGenerator.js';
|
import type { ContentGenerator } from './contentGenerator.js';
|
||||||
import {
|
import {
|
||||||
DEFAULT_GEMINI_FLASH_MODEL,
|
DEFAULT_GEMINI_FLASH_MODEL,
|
||||||
DEFAULT_GEMINI_MODEL_AUTO,
|
|
||||||
DEFAULT_THINKING_MODE,
|
DEFAULT_THINKING_MODE,
|
||||||
getEffectiveModel,
|
getEffectiveModel,
|
||||||
} from '../config/models.js';
|
} from '../config/models.js';
|
||||||
@@ -56,11 +55,7 @@ import { debugLogger } from '../utils/debugLogger.js';
|
|||||||
import type { ModelConfigKey } from '../services/modelConfigService.js';
|
import type { ModelConfigKey } from '../services/modelConfigService.js';
|
||||||
|
|
||||||
export function isThinkingSupported(model: string) {
|
export function isThinkingSupported(model: string) {
|
||||||
return (
|
return !model.startsWith('gemini-2.0');
|
||||||
model.startsWith('gemini-2.5') ||
|
|
||||||
model.startsWith('gemini-3') ||
|
|
||||||
model === DEFAULT_GEMINI_MODEL_AUTO
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_TURNS = 100;
|
const MAX_TURNS = 100;
|
||||||
|
|||||||
Reference in New Issue
Block a user