From a7d29952b0f630b1a27fabce97cef4364079ef51 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Wed, 11 Dec 2024 18:14:44 -0800 Subject: [PATCH] draft bug fix --- docs/zero_to_hero_guide/email_agent/README.md | 6 +++++- docs/zero_to_hero_guide/email_agent/email_agent.py | 2 +- docs/zero_to_hero_guide/email_agent/main.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/zero_to_hero_guide/email_agent/README.md b/docs/zero_to_hero_guide/email_agent/README.md index f578e57db..4e30cf57d 100644 --- a/docs/zero_to_hero_guide/email_agent/README.md +++ b/docs/zero_to_hero_guide/email_agent/README.md @@ -26,7 +26,11 @@ pip install -r requirements.txt # Run Email Agent -The steps are also the same as the [original app]((https://github.com/meta-llama/llama-recipes/tree/gmagent/recipes/use_cases/email_agent). +The steps are also the same as the [original app]((https://github.com/meta-llama/llama-recipes/tree/gmagent/recipes/use_cases/email_agent): + +``` +python main.py --gmail +``` # Implementation Notes Notes here mainly cover how custom tools (functions) are defined and how the Llama Stack Agent class is used with the custom tools. diff --git a/docs/zero_to_hero_guide/email_agent/email_agent.py b/docs/zero_to_hero_guide/email_agent/email_agent.py index 0b55aa14e..9e372fb22 100644 --- a/docs/zero_to_hero_guide/email_agent/email_agent.py +++ b/docs/zero_to_hero_guide/email_agent/email_agent.py @@ -423,7 +423,7 @@ def create_forward_draft(message_id, recipient_email, custom_message=None): def send_draft(id): sent_message = service.users().drafts().send( userId=user_id, - body={'id': id} + body={'id': memory['draft_id']} ).execute() return f"Draft sent with email ID: {sent_message['id']}" diff --git a/docs/zero_to_hero_guide/email_agent/main.py b/docs/zero_to_hero_guide/email_agent/main.py index 1c3fdfc53..f4d37ed0a 100644 --- a/docs/zero_to_hero_guide/email_agent/main.py +++ b/docs/zero_to_hero_guide/email_agent/main.py @@ -123,7 +123,7 @@ async def main(): elif tool_name == "get_pdf_summary": output = result - print(f"\n-------------------------\n\nGmagent: {output}\n") + print(f"\n-------------------------\n\nAgent: {output}\n") elif log.role == "inference": print("Llama returned: ", end="") else: