mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 13:34:15 -07:00
feat(core): Migrate generateJson to resolved model configs. (#12626)
This commit is contained in:
@@ -735,6 +735,12 @@ describe('LoopDetectionService LLM Checks', () => {
|
||||
getBaseLlmClient: () => mockBaseLlmClient,
|
||||
getDebugMode: () => false,
|
||||
getTelemetryEnabled: () => true,
|
||||
modelConfigService: {
|
||||
getResolvedConfig: vi.fn().mockReturnValue({
|
||||
model: 'cognitive-loop-v1',
|
||||
generateContentConfig: {},
|
||||
}),
|
||||
},
|
||||
} as unknown as Config;
|
||||
|
||||
service = new LoopDetectionService(mockConfig);
|
||||
@@ -765,9 +771,9 @@ describe('LoopDetectionService LLM Checks', () => {
|
||||
expect(mockBaseLlmClient.generateJson).toHaveBeenCalledTimes(1);
|
||||
expect(mockBaseLlmClient.generateJson).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
modelConfigKey: expect.any(Object),
|
||||
systemInstruction: expect.any(String),
|
||||
contents: expect.any(Array),
|
||||
model: expect.any(String),
|
||||
schema: expect.any(Object),
|
||||
promptId: expect.any(String),
|
||||
}),
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
LoopType,
|
||||
} from '../telemetry/types.js';
|
||||
import type { Config } from '../config/config.js';
|
||||
import { DEFAULT_GEMINI_FLASH_MODEL } from '../config/config.js';
|
||||
import {
|
||||
isFunctionCall,
|
||||
isFunctionResponse,
|
||||
@@ -436,9 +435,9 @@ export class LoopDetectionService {
|
||||
let result;
|
||||
try {
|
||||
result = await this.config.getBaseLlmClient().generateJson({
|
||||
modelConfigKey: { model: 'loop-detection' },
|
||||
contents,
|
||||
schema,
|
||||
model: DEFAULT_GEMINI_FLASH_MODEL,
|
||||
systemInstruction: LOOP_DETECTION_SYSTEM_PROMPT,
|
||||
abortSignal: signal,
|
||||
promptId: this.promptId,
|
||||
|
||||
@@ -48,6 +48,13 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gemini-2.5-flash-base": {
|
||||
"model": "gemini-2.5-flash",
|
||||
"generateContentConfig": {
|
||||
"temperature": 0,
|
||||
"topP": 1
|
||||
}
|
||||
},
|
||||
"classifier": {
|
||||
"model": "gemini-2.5-flash-lite",
|
||||
"generateContentConfig": {
|
||||
@@ -119,5 +126,26 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"loop-detection": {
|
||||
"model": "gemini-2.5-flash",
|
||||
"generateContentConfig": {
|
||||
"temperature": 0,
|
||||
"topP": 1
|
||||
}
|
||||
},
|
||||
"llm-edit-fixer": {
|
||||
"model": "gemini-2.5-flash",
|
||||
"generateContentConfig": {
|
||||
"temperature": 0,
|
||||
"topP": 1
|
||||
}
|
||||
},
|
||||
"next-speaker-checker": {
|
||||
"model": "gemini-2.5-flash",
|
||||
"generateContentConfig": {
|
||||
"temperature": 0,
|
||||
"topP": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user