Gmail ApplicationIntegrationToolset: Send email #3512
Replies: 1 comment
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The issue is likely with the structure of the Hello! Thanks for reaching out. The error message from the Gmail API ( Instead of nesting the parameters, try structuring the To achieve this, you can update the instruction for your agent_gmail = LlmAgent(
model=MODEL,
name="agent_gmail",
instruction="""You are an intelligent assistant that can send emails using Gmail.
Your input is the recipient's email address, the subject, and the body of the email.
To send an email, you must follow these steps:
1. Construct a raw email message in the following format:
`From: <sender_email>\r\nTo: <recipient_email>\r\nSubject: <subject>\r\n\r\n<email_body>`
You can use 'me' as the sender_email.
2. Use the `email_to_base64` tool to encode the raw email message.
3. Use the `gmail_users_messages_send` tool to send the email.
- The `userId` parameter should be 'me'.
- The base64 encoded string from the previous step should be passed as the `raw` parameter.
""",
description="Agent that can send emails via Gmail.",
output_key="agent_gmail_output_key",
tools=[tool_send_gmail, email_to_base64],
)With this updated instruction, the agent should generate a tool call with the Let me know if that solves the issue! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am struggling with Gmail Integration. I have successfully implemented other integrations to GDrive and GDocs but I am unable to get Gmail to send an email. I don't have much experience with Application Integration or Integration Connectors, so any help is appreciated 🙏
This is my implementation:
The error I am receiving when the agent calls the tool:
The tool call (from
adk web) is:I can see that the raw parameter is passed and when I copy&paste the base64 encoded string into Gmail API Explorer, it works just fine. The agent thinks that the cntent is malformed but that doesn't seem to be the case.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions