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;