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.
Code
cookbook/tools/gmail_tools.py
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
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.
from agno.agent import Agent
from agno.tools.gmail import GmailTools
agent = Agent(
name="Gmail Agent",
tools=[GmailTools()],
instructions=[
"Based on user query, you can read, draft and send emails using Gmail.",
"While showing email contents, you can summarize the email contents, extract key details and dates.",
"Show the email contents in a structured markdown format.",
],
markdown=True,
show_tool_calls=True,
)
# Send a reply to an email
agent.print_response(
"Send a reply to the last email saying 'Thank you for your message. I'll get back to you soon.'",
stream=True,
)
Create a virtual environment
Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set up Gmail credentials
export GOOGLE_CLIENT_ID=xxx
export GOOGLE_CLIENT_SECRET=xxx
export GOOGLE_PROJECT_ID=xxx
Was this page helpful?