You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add thinkingLevel and thinkingBudget config for Gemini models
Add per-model thinking configuration for Google Generative AI and Google
Vertex providers. `thinkingLevel` controls reasoning depth for Gemini 3
models, and `thinkingBudget` sets the thinking token budget for Gemini
2.5 models. Deprecates the GOOGLE_VERTEX_THINKING_BUDGET_TOKENS env var
in favor of the new per-model config (with fallback).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/snippets/schemas/v3/index.schema.mdx
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2300,6 +2300,20 @@
2300
2300
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2301
2301
"description": "Optional base URL."
2302
2302
},
2303
+
"thinkingLevel": {
2304
+
"type": "string",
2305
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2306
+
"enum": [
2307
+
"minimal",
2308
+
"low",
2309
+
"medium",
2310
+
"high"
2311
+
]
2312
+
},
2313
+
"thinkingBudget": {
2314
+
"type": "integer",
2315
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2316
+
},
2303
2317
"temperature": {
2304
2318
"type": "number",
2305
2319
"description": "Optional temperature setting to use with the model."
@@ -2548,6 +2562,20 @@
2548
2562
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2549
2563
"description": "Optional base URL."
2550
2564
},
2565
+
"thinkingLevel": {
2566
+
"type": "string",
2567
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2568
+
"enum": [
2569
+
"minimal",
2570
+
"low",
2571
+
"medium",
2572
+
"high"
2573
+
]
2574
+
},
2575
+
"thinkingBudget": {
2576
+
"type": "integer",
2577
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2578
+
},
2551
2579
"temperature": {
2552
2580
"type": "number",
2553
2581
"description": "Optional temperature setting to use with the model."
@@ -3838,6 +3866,20 @@
3838
3866
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
3839
3867
"description": "Optional base URL."
3840
3868
},
3869
+
"thinkingLevel": {
3870
+
"type": "string",
3871
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
3872
+
"enum": [
3873
+
"minimal",
3874
+
"low",
3875
+
"medium",
3876
+
"high"
3877
+
]
3878
+
},
3879
+
"thinkingBudget": {
3880
+
"type": "integer",
3881
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
3882
+
},
3841
3883
"temperature": {
3842
3884
"type": "number",
3843
3885
"description": "Optional temperature setting to use with the model."
@@ -4086,6 +4128,20 @@
4086
4128
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
4087
4129
"description": "Optional base URL."
4088
4130
},
4131
+
"thinkingLevel": {
4132
+
"type": "string",
4133
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
4134
+
"enum": [
4135
+
"minimal",
4136
+
"low",
4137
+
"medium",
4138
+
"high"
4139
+
]
4140
+
},
4141
+
"thinkingBudget": {
4142
+
"type": "integer",
4143
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
4144
+
},
4089
4145
"temperature": {
4090
4146
"type": "number",
4091
4147
"description": "Optional temperature setting to use with the model."
Copy file name to clipboardExpand all lines: docs/snippets/schemas/v3/languageModel.schema.mdx
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -614,6 +614,20 @@
614
614
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
615
615
"description": "Optional base URL."
616
616
},
617
+
"thinkingLevel": {
618
+
"type": "string",
619
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
620
+
"enum": [
621
+
"minimal",
622
+
"low",
623
+
"medium",
624
+
"high"
625
+
]
626
+
},
627
+
"thinkingBudget": {
628
+
"type": "integer",
629
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
630
+
},
617
631
"temperature": {
618
632
"type": "number",
619
633
"description": "Optional temperature setting to use with the model."
@@ -862,6 +876,20 @@
862
876
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
863
877
"description": "Optional base URL."
864
878
},
879
+
"thinkingLevel": {
880
+
"type": "string",
881
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
882
+
"enum": [
883
+
"minimal",
884
+
"low",
885
+
"medium",
886
+
"high"
887
+
]
888
+
},
889
+
"thinkingBudget": {
890
+
"type": "integer",
891
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
892
+
},
865
893
"temperature": {
866
894
"type": "number",
867
895
"description": "Optional temperature setting to use with the model."
@@ -2152,6 +2180,20 @@
2152
2180
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2153
2181
"description": "Optional base URL."
2154
2182
},
2183
+
"thinkingLevel": {
2184
+
"type": "string",
2185
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2186
+
"enum": [
2187
+
"minimal",
2188
+
"low",
2189
+
"medium",
2190
+
"high"
2191
+
]
2192
+
},
2193
+
"thinkingBudget": {
2194
+
"type": "integer",
2195
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2196
+
},
2155
2197
"temperature": {
2156
2198
"type": "number",
2157
2199
"description": "Optional temperature setting to use with the model."
@@ -2400,6 +2442,20 @@
2400
2442
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2401
2443
"description": "Optional base URL."
2402
2444
},
2445
+
"thinkingLevel": {
2446
+
"type": "string",
2447
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2448
+
"enum": [
2449
+
"minimal",
2450
+
"low",
2451
+
"medium",
2452
+
"high"
2453
+
]
2454
+
},
2455
+
"thinkingBudget": {
2456
+
"type": "integer",
2457
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2458
+
},
2403
2459
"temperature": {
2404
2460
"type": "number",
2405
2461
"description": "Optional temperature setting to use with the model."
Copy file name to clipboardExpand all lines: packages/schemas/src/v3/index.schema.ts
+56Lines changed: 56 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2299,6 +2299,20 @@ const schema = {
2299
2299
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2300
2300
"description": "Optional base URL."
2301
2301
},
2302
+
"thinkingLevel": {
2303
+
"type": "string",
2304
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2305
+
"enum": [
2306
+
"minimal",
2307
+
"low",
2308
+
"medium",
2309
+
"high"
2310
+
]
2311
+
},
2312
+
"thinkingBudget": {
2313
+
"type": "integer",
2314
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2315
+
},
2302
2316
"temperature": {
2303
2317
"type": "number",
2304
2318
"description": "Optional temperature setting to use with the model."
@@ -2547,6 +2561,20 @@ const schema = {
2547
2561
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2548
2562
"description": "Optional base URL."
2549
2563
},
2564
+
"thinkingLevel": {
2565
+
"type": "string",
2566
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2567
+
"enum": [
2568
+
"minimal",
2569
+
"low",
2570
+
"medium",
2571
+
"high"
2572
+
]
2573
+
},
2574
+
"thinkingBudget": {
2575
+
"type": "integer",
2576
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2577
+
},
2550
2578
"temperature": {
2551
2579
"type": "number",
2552
2580
"description": "Optional temperature setting to use with the model."
@@ -3837,6 +3865,20 @@ const schema = {
3837
3865
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
3838
3866
"description": "Optional base URL."
3839
3867
},
3868
+
"thinkingLevel": {
3869
+
"type": "string",
3870
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
3871
+
"enum": [
3872
+
"minimal",
3873
+
"low",
3874
+
"medium",
3875
+
"high"
3876
+
]
3877
+
},
3878
+
"thinkingBudget": {
3879
+
"type": "integer",
3880
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
3881
+
},
3840
3882
"temperature": {
3841
3883
"type": "number",
3842
3884
"description": "Optional temperature setting to use with the model."
@@ -4085,6 +4127,20 @@ const schema = {
4085
4127
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
4086
4128
"description": "Optional base URL."
4087
4129
},
4130
+
"thinkingLevel": {
4131
+
"type": "string",
4132
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
4133
+
"enum": [
4134
+
"minimal",
4135
+
"low",
4136
+
"medium",
4137
+
"high"
4138
+
]
4139
+
},
4140
+
"thinkingBudget": {
4141
+
"type": "integer",
4142
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
4143
+
},
4088
4144
"temperature": {
4089
4145
"type": "number",
4090
4146
"description": "Optional temperature setting to use with the model."
* Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels
967
+
*/
968
+
thinkingLevel?: "minimal"|"low"|"medium"|"high";
969
+
/**
970
+
* Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget
971
+
*/
972
+
thinkingBudget?: number;
965
973
/**
966
974
* Optional temperature setting to use with the model.
* Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels
1069
+
*/
1070
+
thinkingLevel?: "minimal"|"low"|"medium"|"high";
1071
+
/**
1072
+
* Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget
1073
+
*/
1074
+
thinkingBudget?: number;
1059
1075
/**
1060
1076
* Optional temperature setting to use with the model.
Copy file name to clipboardExpand all lines: packages/schemas/src/v3/languageModel.schema.ts
+56Lines changed: 56 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -613,6 +613,20 @@ const schema = {
613
613
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
614
614
"description": "Optional base URL."
615
615
},
616
+
"thinkingLevel": {
617
+
"type": "string",
618
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
619
+
"enum": [
620
+
"minimal",
621
+
"low",
622
+
"medium",
623
+
"high"
624
+
]
625
+
},
626
+
"thinkingBudget": {
627
+
"type": "integer",
628
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
629
+
},
616
630
"temperature": {
617
631
"type": "number",
618
632
"description": "Optional temperature setting to use with the model."
@@ -861,6 +875,20 @@ const schema = {
861
875
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
862
876
"description": "Optional base URL."
863
877
},
878
+
"thinkingLevel": {
879
+
"type": "string",
880
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
881
+
"enum": [
882
+
"minimal",
883
+
"low",
884
+
"medium",
885
+
"high"
886
+
]
887
+
},
888
+
"thinkingBudget": {
889
+
"type": "integer",
890
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
891
+
},
864
892
"temperature": {
865
893
"type": "number",
866
894
"description": "Optional temperature setting to use with the model."
@@ -2151,6 +2179,20 @@ const schema = {
2151
2179
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2152
2180
"description": "Optional base URL."
2153
2181
},
2182
+
"thinkingLevel": {
2183
+
"type": "string",
2184
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2185
+
"enum": [
2186
+
"minimal",
2187
+
"low",
2188
+
"medium",
2189
+
"high"
2190
+
]
2191
+
},
2192
+
"thinkingBudget": {
2193
+
"type": "integer",
2194
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2195
+
},
2154
2196
"temperature": {
2155
2197
"type": "number",
2156
2198
"description": "Optional temperature setting to use with the model."
@@ -2399,6 +2441,20 @@ const schema = {
2399
2441
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
2400
2442
"description": "Optional base URL."
2401
2443
},
2444
+
"thinkingLevel": {
2445
+
"type": "string",
2446
+
"description": "Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels",
2447
+
"enum": [
2448
+
"minimal",
2449
+
"low",
2450
+
"medium",
2451
+
"high"
2452
+
]
2453
+
},
2454
+
"thinkingBudget": {
2455
+
"type": "integer",
2456
+
"description": "Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget"
2457
+
},
2402
2458
"temperature": {
2403
2459
"type": "number",
2404
2460
"description": "Optional temperature setting to use with the model."
* Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels
301
+
*/
302
+
thinkingLevel?: "minimal"|"low"|"medium"|"high";
303
+
/**
304
+
* Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget
305
+
*/
306
+
thinkingBudget?: number;
299
307
/**
300
308
* Optional temperature setting to use with the model.
* Optional thinking level for Gemini 3 models. Controls the depth of reasoning the model performs. See https://ai.google.dev/gemini-api/docs/thinking#thinking-levels
403
+
*/
404
+
thinkingLevel?: "minimal"|"low"|"medium"|"high";
405
+
/**
406
+
* Optional thinking budget for Gemini 2.5 models. Sets the number of thinking tokens the model can use when generating a response. Set to -1 for dynamic thinking. See https://ai.google.dev/gemini-api/docs/thinking#set-budget
407
+
*/
408
+
thinkingBudget?: number;
393
409
/**
394
410
* Optional temperature setting to use with the model.
0 commit comments