Code

cookbook/reasoning/tools/gemini_thinking_tools.py
from agno.agent import Agent
from agno.models.google import Gemini
from agno.tools.thinking import ThinkingTools
from agno.tools.duckduckgo import DuckDuckGoTools

thinking_agent = Agent(
    model=Gemini(id="gemini-2.0-flash"),
    tools=[
        ThinkingTools(add_instructions=True),
        DuckDuckGoTools(
            search=True,
            news=True,
        ),
    ],
    instructions="Use tables where possible",
    show_tool_calls=True,
    markdown=True,
    stream_intermediate_steps=True,
)

# Financial analysis with thinking tools
thinking_agent.print_response(
    "Analyze the current state of cryptocurrency markets vs traditional banking. "
    "Think through the key differences, risks, and opportunities for investors.", 
    stream=True, 
    show_reasoning=True
)

# Market trend analysis
thinking_agent.print_response(
    "Compare the financial performance and market outlook of electric vehicle companies "
    "versus traditional automotive manufacturers. Consider Tesla, Ford, and GM in your analysis.",
    stream=True,
    show_reasoning=True
)


Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2

Set your API key

export GOOGLE_API_KEY=xxx
3

Install libraries

pip install -U google-genai agno
4

Run Agent

python cookbook/reasoning/tools/gemini_thinking_tools.py