draft bug fix

This commit is contained in:
Jeff Tang 2024-12-11 18:14:44 -08:00
parent 61e837380c
commit a7d29952b0
3 changed files with 7 additions and 3 deletions

View file

@ -26,7 +26,11 @@ pip install -r requirements.txt
# Run Email Agent # 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 <your_gmail_address>
```
# Implementation Notes # 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. Notes here mainly cover how custom tools (functions) are defined and how the Llama Stack Agent class is used with the custom tools.

View file

@ -423,7 +423,7 @@ def create_forward_draft(message_id, recipient_email, custom_message=None):
def send_draft(id): def send_draft(id):
sent_message = service.users().drafts().send( sent_message = service.users().drafts().send(
userId=user_id, userId=user_id,
body={'id': id} body={'id': memory['draft_id']}
).execute() ).execute()
return f"Draft sent with email ID: {sent_message['id']}" return f"Draft sent with email ID: {sent_message['id']}"

View file

@ -123,7 +123,7 @@ async def main():
elif tool_name == "get_pdf_summary": elif tool_name == "get_pdf_summary":
output = result output = result
print(f"\n-------------------------\n\nGmagent: {output}\n") print(f"\n-------------------------\n\nAgent: {output}\n")
elif log.role == "inference": elif log.role == "inference":
print("Llama returned: ", end="") print("Llama returned: ", end="")
else: else: