EmailTools enable an Agent to send an email to a user. The Agent can send an email to a user with a specific subject and body.
Example
1from kern.agent import Agent2from kern.tools.email import EmailTools34receiver_email = "<receiver_email>"5sender_email = "<sender_email>"6sender_name = "<sender_name>"7sender_passkey = "<sender_passkey>"89agent = Agent(10 tools=[11 EmailTools(12 receiver_email=receiver_email,13 sender_email=sender_email,14 sender_name=sender_name,15 sender_passkey=sender_passkey,16 )17 ]18)1920agent.print_response("send an email to <receiver_email>")Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
receiver_email | Optional[str] | None | The email address of the receiver. |
sender_name | Optional[str] | None | The name of the sender. |
sender_email | Optional[str] | None | The email address of the sender. |
sender_passkey | Optional[str] | None | The passkey for the sender's email. |
enable_email_user | bool | True | Enable the email_user function. |
all | bool | False | Enable all available functions. |
Toolkit Functions
| Function | Description |
|---|---|
email_user | Emails the user with the given subject and body. Parameters include subject (str) for the email subject and body (str) for the email content. Currently works with Gmail. Returns "email sent successfully" or error message. |
Developer Resources
- View Tools