|
| 1 | +# Gemini Thinking Mode |
| 2 | + |
| 3 | +This guide explains how to use and customize Gemini's Thinking Mode in BotGem. Thinking Mode is enabled by default for Gemini 2.5 series models, allowing them to perform more complex reasoning and solve challenging tasks. |
| 4 | + |
| 5 | +## How to Customize Thinking Mode for Gemini 2.5 Models |
| 6 | + |
| 7 | +> **Note**: Thinking is enabled by default for the Gemini 2.5 series models. The following configuration allows you to customize the thinking behavior and make it visible in responses. |
| 8 | +> |
| 9 | +> Thought summaries offer insights into the model's internal reasoning process. This feature can be valuable for verifying the model's approach and keeping users informed during longer tasks, especially when combined with streaming. |
| 10 | +
|
| 11 | +{.dark-only} |
| 12 | +{.light-only} |
| 13 | + |
| 14 | +You can enable thought summaries (make the thinking process visible) in the chat window by following these steps: |
| 15 | + |
| 16 | +1. Click the **settings icon** in the top right corner of the chat window |
| 17 | +2. Find the **Parameters** input field in the settings panel |
| 18 | +3. Copy the following configuration into **Parameters**: |
| 19 | + |
| 20 | +```json |
| 21 | +{ |
| 22 | + "thinkingConfig": { |
| 23 | + "includeThoughts": true |
| 24 | + } |
| 25 | +} |
| 26 | +``` |
| 27 | + |
| 28 | +## Understanding Thinking Mode |
| 29 | + |
| 30 | +Gemini Thinking Mode allows the model to engage in more detailed reasoning before providing a response. This feature is particularly useful for: |
| 31 | + |
| 32 | +- Complex problem-solving |
| 33 | +- Multi-step reasoning tasks |
| 34 | +- Detailed analysis and planning |
| 35 | +- Code generation and debugging |
| 36 | + |
| 37 | +While thinking is enabled by default for Gemini 2.5 series models, the `thinkingConfig` parameter with `includeThoughts` set to `true` allows you to see the model's reasoning process through thought summaries. These summaries offer insights into the model's internal reasoning, making the thinking visible in the response and giving you insight into how the model arrived at its conclusions. |
| 38 | + |
| 39 | +Thought summaries are valuable for: |
| 40 | +- Verifying the model's approach to solving problems |
| 41 | +- Understanding the reasoning behind complex answers |
| 42 | +- Keeping users informed during longer tasks |
| 43 | +- Identifying where reasoning might have gone wrong |
| 44 | + |
| 45 | +If you want to adjust the thinking process further, you can also set a thinking budget: |
| 46 | + |
| 47 | +```json |
| 48 | +{ |
| 49 | + "thinkingConfig": { |
| 50 | + "includeThoughts": true, |
| 51 | + "thinkingBudget": 16000 |
| 52 | + } |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +The `thinkingBudget` parameter lets you guide the model on the number of thinking tokens it can use when generating a response: |
| 57 | + |
| 58 | +- **Range**: Must be an integer from 0 to 24576 tokens |
| 59 | +- **Default**: If not specified, Gemini will dynamically adjust the budget based on the complexity of the request |
| 60 | +- **Disable thinking**: Setting the budget to 0 disables thinking completely |
| 61 | +- **Recommended for complex tasks**: 8000-16000 tokens |
| 62 | +- **Model support**: Note that `thinkingBudget` is only supported in Gemini 2.5 Flash |
| 63 | + |
| 64 | +A higher token count generally allows for more detailed reasoning, which can be beneficial for tackling more complex tasks. Depending on the prompt, the model might overflow or underflow the token budget. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +## Troubleshooting |
| 69 | + |
| 70 | +If you encounter issues with Thinking Mode: |
| 71 | + |
| 72 | +- Ensure your Google API key has access to Gemini 2.5 models |
| 73 | +- Verify that the parameters are correctly formatted in JSON |
| 74 | +- Try adjusting the thinking budget if responses are incomplete or not detailed enough |
| 75 | +- For very complex tasks, consider breaking them down into smaller steps |
| 76 | + |
| 77 | +For more information about Google Gemini configuration, see the [Google AI Configuration Guide](google-configuration.md). |
0 commit comments