ThinkingConfig interface
Stay organized with collections
Save and categorize content based on your preferences.
Configuration for "thinking" behavior of compatible Gemini models.
Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer.
Signature:
export interface ThinkingConfig
Properties
Property |
Type |
Description |
thinkingBudget |
number |
The thinking budget, in tokens.This parameter sets an upper limit on the number of tokens the model can use for its internal "thinking" process. A higher budget may result in higher quality responses for complex tasks but can also increase latency and cost.If you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt.An error will be thrown if you set a thinking budget for a model that does not support this feature or if the specified budget is not within the model's supported range. |
ThinkingConfig.thinkingBudget
The thinking budget, in tokens.
This parameter sets an upper limit on the number of tokens the model can use for its internal "thinking" process. A higher budget may result in higher quality responses for complex tasks but can also increase latency and cost.
If you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt.
An error will be thrown if you set a thinking budget for a model that does not support this feature or if the specified budget is not within the model's supported range.
Signature:
thinkingBudget?: number;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-17 UTC.
[null,null,["Last updated 2025-07-17 UTC."],[],[],null,["Configuration for \"thinking\" behavior of compatible Gemini models.\n\nCertain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer.\n\n**Signature:** \n\n export interface ThinkingConfig \n\nProperties\n\n| Property | Type | Description |\n|-----------------------------------------------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [thinkingBudget](./ai.thinkingconfig.md#thinkingconfigthinkingbudget) | number | The thinking budget, in tokens.This parameter sets an upper limit on the number of tokens the model can use for its internal \"thinking\" process. A higher budget may result in higher quality responses for complex tasks but can also increase latency and cost.If you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt.An error will be thrown if you set a thinking budget for a model that does not support this feature or if the specified budget is not within the model's supported range. |\n\nThinkingConfig.thinkingBudget\n\nThe thinking budget, in tokens.\n\nThis parameter sets an upper limit on the number of tokens the model can use for its internal \"thinking\" process. A higher budget may result in higher quality responses for complex tasks but can also increase latency and cost.\n\nIf you don't specify a budget, the model will determine the appropriate amount of thinking based on the complexity of the prompt.\n\nAn error will be thrown if you set a thinking budget for a model that does not support this feature or if the specified budget is not within the model's supported range.\n\n**Signature:** \n\n thinkingBudget?: number;"]]