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.
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.includeThoughts
Whether to include "thought summaries" in the model's response.
Thought summaries provide a brief overview of the model's internal thinking process, offering insight into how it arrived at the final answer. This can be useful for debugging, understanding the model's reasoning, and verifying its accuracy.
Signature:
includeThoughts?:boolean;
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 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| [includeThoughts](./ai.thinkingconfig.md#thinkingconfigincludethoughts) | boolean | Whether to include \"thought summaries\" in the model's response. |\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.includeThoughts\n\nWhether to include \"thought summaries\" in the model's response.\n\nThought summaries provide a brief overview of the model's internal thinking process, offering insight into how it arrived at the final answer. This can be useful for debugging, understanding the model's reasoning, and verifying its accuracy.\n\n**Signature:** \n\n includeThoughts?: boolean;\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;"]]