Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference {% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %} # ThinkingConfig interface 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: ```typescript export interface ThinkingConfig ``` ## Properties | Property | Type | Description | | --- | --- | --- | | [includeThoughts](./ai.thinkingconfig.md#thinkingconfigincludethoughts) | boolean | Whether to include "thought summaries" in the model's response. | | [thinkingBudget](./ai.thinkingconfig.md#thinkingconfigthinkingbudget) | number | The thinking budget, in tokens. | | [thinkingLevel](./ai.thinkingconfig.md#thinkingconfigthinkinglevel) | [ThinkingLevel](./ai.md#thinkinglevel) | If not specified, Gemini will use the model's default dynamic thinking level. | ## 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: ```typescript 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. The range of supported thinking budget values depends on the model. 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. The model will also error if `thinkingLevel` and `thinkingBudget` are both set. Signature: ```typescript thinkingBudget?: number; ``` ## ThinkingConfig.thinkingLevel If not specified, Gemini will use the model's default dynamic thinking level. Note: The model will error if `thinkingLevel` and `thinkingBudget` are both set. Important: Gemini 2.5 series models do not support thinking levels; use `thinkingBudget` to set a thinking budget instead. Signature: ```typescript thinkingLevel?: ThinkingLevel; ```