Examples
- Examples
- Getting Started
- Agents
- Teams
- Workflows
- Applications
- Streamlit Apps
- Evals
Agent Concepts
- Reasoning
- Multimodal
- RAG
- User Control Flows
- Knowledge
- Memory
- Async
- Hybrid Search
- Storage
- Tools
- Search
- Social
- Web Scraping
- Database
- Local
- Native Model Toolkit
- APIs & External Services
- MCP
- Vector Databases
- Context
- Embedders
- Agent State
- Observability
- Testing
- Miscellaneous
Models
- Anthropic
- AWS Bedrock
- AWS Bedrock Claude
- Azure AI Foundry
- Azure OpenAI
- Cerebras
- Cerebras OpenAI
- Cohere
- DeepInfra
- DeepSeek
- Fireworks
- Gemini
- Groq
- Hugging Face
- IBM
- LM Studio
- LiteLLM
- LiteLLM OpenAI
- Meta
- Mistral
- Nebius
- NVIDIA
- Ollama
- OpenAI
- Perplexity
- Together
- XAI
- Vercel
- vLLM
Search
Google Search Tools
Code
cookbook/tools/googlesearch_tools.py
Copy
Ask AI
from agno.agent import Agent
from agno.tools.googlesearch import GoogleSearchTools
agent = Agent(
tools=[GoogleSearchTools()],
show_tool_calls=True,
markdown=True,
)
agent.print_response("What are the latest developments in AI?")
Usage
1
Create a virtual environment
Open the Terminal
and create a python virtual environment.
Copy
Ask AI
python3 -m venv .venv
source .venv/bin/activate
2
Set your API credentials
Copy
Ask AI
export GOOGLE_CSE_ID=xxx
export GOOGLE_API_KEY=xxx
export OPENAI_API_KEY=xxx
3
Install libraries
Copy
Ask AI
pip install -U google-api-python-client openai agno
4
Run Agent
Copy
Ask AI
python cookbook/tools/googlesearch_tools.py
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.