Skip to content

Commit a245d65

Browse files
committed
feat: support more Gemini flash thinking models
1 parent 1767bf4 commit a245d65

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

runner/codegen/ai-sdk-runner.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ const SUPPORTED_MODELS = [
3535
'claude-sonnet-4.5-with-thinking-32k',
3636
'gemini-2.5-flash-lite',
3737
'gemini-2.5-flash',
38-
'gemini-2.5-flash-with-dynamic-thinking',
38+
'gemini-2.5-flash-with-thinking-dynamic',
39+
'gemini-2.5-flash-with-thinking-16k',
40+
'gemini-2.5-flash-with-thinking-24k',
3941
'gemini-2.5-pro',
4042
'gemini-3-pro-preview',
4143
'gpt-5.1-no-thinking',
@@ -210,15 +212,23 @@ export class AiSDKRunner implements LlmRunner {
210212
} satisfies GoogleGenerativeAIProviderOptions,
211213
},
212214
};
213-
case 'gemini-2.5-flash-with-dynamic-thinking':
215+
case 'gemini-2.5-flash-with-thinking-dynamic':
216+
case 'gemini-2.5-flash-with-thinking-16k':
217+
case 'gemini-2.5-flash-with-thinking-24k':
218+
// -1 means "dynamic thinking budget":
219+
// https://ai.google.dev/gemini-api/docs/thinking#set-budget.
220+
let thinkingBudget = -1;
221+
if (modelName.endsWith('-16k')) {
222+
thinkingBudget = 16_000;
223+
} else if (modelName.endsWith('-24k')) {
224+
thinkingBudget = 24_000;
225+
}
214226
return {
215227
model: google('gemini-2.5-flash'),
216228
providerOptions: {
217229
google: {
218230
thinkingConfig: {
219-
// -1 means "dynamic thinking budget":
220-
// https://ai.google.dev/gemini-api/docs/thinking#set-budget.
221-
thinkingBudget: -1,
231+
thinkingBudget: thinkingBudget,
222232
includeThoughts: true,
223233
},
224234
} satisfies GoogleGenerativeAIProviderOptions,

0 commit comments

Comments
 (0)