Gemini 3 Pro Thinking Level
Set Gemini 3.1 Pro Preview thinking level and stream an asynchronous response.
"""
Async example using Gemini with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.google import Gemini
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=Gemini(id="gemini-3.1-pro-preview", thinking_level="low"),
markdown=True,
)
asyncio.run(agent.aprint_response("Whats the current news in France?", stream=True))
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
passRun the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno google-genaiExport your Google API key
export GOOGLE_API_KEY="your_google_api_key_here"Choose a prompt for this configuration
The agent has no search tool. Replace the current-news prompt with a reasoning task, or enable search=True on Gemini when you need current web information.
Run the example
Save the code above as gemini_3_pro_thinking_level.py, then run:
python gemini_3_pro_thinking_level.pyFull source: cookbook/90_models/google/gemini/gemini_3_pro_thinking_level.py