Documentation Index
Fetch the complete documentation index at: https://docs-v1.agno.com/llms.txt
Use this file to discover all available pages before exploring further.
Serper is a Google Search API that provides access to Google search results, news articles, academic papers from Google Scholar, business reviews, and web scraping capabilities.
Setup
Get an API key from Serper Console.
Examples
cookbook/tools/serper_tools.py
from agno.agent import Agent
from agno.tools.serper import SerperTools
agent = Agent(
tools=[SerperTools()],
show_tool_calls=True,
)
agent.print_response(
"Search for the latest news about artificial intelligence developments",
markdown=True,
)
Usage
Create a virtual environment
Open the Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set your API key
export SERPER_API_KEY=xxx
export OPENAI_API_KEY=xxx
Install libraries
pip install -U requests openai agno
Run Agent
python cookbook/tools/serper_tools.py
Google Scholar Search
agent.print_response(
"Find recent academic papers about large language model safety",
markdown=True,
)
Reviews Search
agent.print_response(
"Analyze reviews for this Google Place ID: ChIJ_Yjh6Za1j4AR8IgGUZGDDTs",
markdown=True
)
Web Scraping
agent.print_response(
"Scrape and summarize content from https://openai.com/index/gpt-4/",
markdown=True
)