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 (#1110)
* 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>
* docs: add changelog entry for thinkingLevel/thinkingBudget
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* remove GOOGLE_VERTEX_INCLUDE_THOUGHTS
* docs: add changelog entry for GOOGLE_VERTEX_INCLUDE_THOUGHTS removal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
- Added `thinkingLevel` and `thinkingBudget` configuration options for Google Generative AI and Google Vertex providers. [#1110](https://github.com/sourcebot-dev/sourcebot/pull/1110)
12
+
13
+
### Changed
14
+
- Deprecated `GOOGLE_VERTEX_THINKING_BUDGET_TOKENS` environment variable in favor of per-model `thinkingBudget` config. [#1110](https://github.com/sourcebot-dev/sourcebot/pull/1110)
15
+
- Removed `GOOGLE_VERTEX_INCLUDE_THOUGHTS` environment variable. Thoughts are now always included. [#1110](https://github.com/sourcebot-dev/sourcebot/pull/1110)
Copy file name to clipboardExpand all lines: docs/docs/configuration/language-model-providers.mdx
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,10 @@ The `reasoningSummary` field controls whether the model returns its reasoning pr
157
157
158
158
[Vercel AI SDK Google Generative AI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai)
159
159
160
+
The `thinkingLevel` field controls the depth of reasoning for Gemini 3 models. Valid values are `minimal`, `low`, `medium`, and `high`. See [thinking levels](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels).
161
+
162
+
The `thinkingBudget` field sets the number of thinking tokens for Gemini 2.5 models. Set to `-1` for dynamic thinking. See [thinking budget](https://ai.google.dev/gemini-api/docs/thinking#set-budget).
163
+
160
164
```json wrap icon="code" Example config with Google Generative AI provider
"thinkingBudget": -1// number of thinking tokens, -1 for dynamic (Gemini 2.5 models)
172
178
}
173
179
]
174
180
}
@@ -181,6 +187,10 @@ The `reasoningSummary` field controls whether the model returns its reasoning pr
181
187
182
188
[Vercel AI SDK Google Vertex AI Docs](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex)
183
189
190
+
The `thinkingLevel` field controls the depth of reasoning for Gemini 3 models. Valid values are `minimal`, `low`, `medium`, and `high`. See [thinking levels](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels).
191
+
192
+
The `thinkingBudget` field sets the number of thinking tokens for Gemini 2.5 models. Set to `-1` for dynamic thinking. See [thinking budget](https://ai.google.dev/gemini-api/docs/thinking#set-budget).
193
+
184
194
```json wrap icon="code" Example config with Google Vertex provider
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.
0 commit comments