Skip to content

Commit

Permalink
partially fix typo, email attachment tool logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pallasite99 committed Jun 11, 2023
1 parent 7aaeb97 commit 15fcbba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions superagi/tools/email/send_email_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class SendEmailAttachmentInput(BaseModel):
to: str = Field(..., description="Email Address of the Receiver, default email address is 'example@example.com'")
subject: str = Field(..., description="Subject of the Email to be sent")
body: str = Field(..., description="Email Body to be sent")
filename: str = Field(..., description="Name of the file to be sent as an Attachement with Email")
filename: str = Field(..., description="Name of the file to be sent as an Attachment with Email")


class SendEmailAttachmentTool(BaseTool):
name: str = "Send Email with Attachement"
name: str = "Send Email with Attachment"
args_schema: Type[BaseModel] = SendEmailAttachmentInput
description: str = "Send an Email with a file attached to it"

Expand All @@ -32,9 +32,9 @@ def _execute(self, to: str, subject: str, body: str, filename: str) -> str:
base_path = base_path + filename
attachmentpath = base_path
attachment = os.path.basename(attachmentpath)
return self.send_email_with_attachement(to, subject, body, attachmentpath, attachment)
return self.send_email_with_attachment(to, subject, body, attachmentpath, attachment)

def send_email_with_attachement(self, to, subject, body, attachment_path, attachment) -> str:
def send_email_with_attachment(self, to, subject, body, attachment_path, attachment) -> str:
email_sender = get_config('EMAIL_ADDRESS')
email_password = get_config('EMAIL_PASSWORD')
if email_sender == "" or email_sender.isspace():
Expand Down

0 comments on commit 15fcbba

Please sign in to comment.