Skip to main content
Compare Gemini 2.5 Flash with thinking disabled against a fixed 1,024-token reasoning model, then inspect the captured reasoning content.
The source labels its first agent “No Reasoning,” but gemini-2.5-flash uses dynamic thinking when thinking_budget is unset. Set thinking_budget=0 on that model to disable thinking for the comparison. See Gemini thinking.
basic_reasoning.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your Google API key

4

Disable thinking on the regular agent

Replace Gemini(id="gemini-2.5-flash") in regular_agent with Gemini(id="gemini-2.5-flash", thinking_budget=0) in the saved file.
5

Run the example

Save the code above as basic_reasoning.py, then run:
Full source: cookbook/10_reasoning/models/gemini/basic_reasoning.py