-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gmail tools improvements and updates
- Loading branch information
1 parent
49dbea9
commit de0194c
Showing
3 changed files
with
115 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
from agno.agent import Agent | ||
from agno.models.google import Gemini | ||
from agno.tools.gmail import GmailTools | ||
|
||
from datetime import datetime, timedelta | ||
agent = Agent( | ||
name="Gmail Agent", | ||
model=Gemini(id="gemini-2.0-flash-exp"), | ||
|
@@ -21,8 +21,31 @@ | |
debug_mode=True, | ||
) | ||
|
||
agent.print_response( | ||
"summarize my last 5 emails with dates and key details, regarding ai agents", | ||
markdown=True, | ||
stream=True, | ||
# agent.print_response( | ||
# "summarize my last 5 emails with dates and key details, regarding ai agents", | ||
# markdown=True, | ||
# stream=True, | ||
# ) | ||
|
||
tool = GmailTools( | ||
credentials_path="storage/credentials.json", | ||
) | ||
|
||
|
||
|
||
# print(tool.get_emails_by_context(context="Security", count=5)) | ||
|
||
thread_id = "194fa616c1f1aa92" | ||
message_id = "CAPe88YDTC4sgdVuiVXR6y7xx8T4tRDi90JacwM9=e7WeSSGkig@mail.gmail.com" | ||
resp = tool.send_email_reply( | ||
thread_id=thread_id, | ||
message_id=message_id, | ||
to="[email protected]", | ||
subject="Re: Security", | ||
body="Hello, I am a security agent. I am here to help you with your security needs.", | ||
cc="", | ||
) | ||
|
||
|
||
# resp = tool.get_latest_emails(count=1) | ||
print(resp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters