Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat: add builtin tools for send email (#10493)
wakaka69c7edb9242c1
diff --git a/api/core/tools/provider/builtin/email/_assets/icon.svg b/api/core/tools/provider/builtin/email/_assets/icon.svgnew file mode 100644index 00000000000..b34f333890b--- /dev/null+++ b/api/core/tools/provider/builtin/email/_assets/icon.svg@@ -0,0 +1 @@+<svg t="1731213160484" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1482" width="200" height="200"><path d="M886.9 312.8c5.6-0.8 10.1 3.5 10.1 9.5l-0.1 34.2-275 215.1-218.3 30.6-274.4-137.8 0.1-34.2c0-6 4.5-11.6 10.2-12.4l747.4-105z" fill="#D5E1FF" p-id="1483"></path><path d="M139.5 418c-5.6 0.8-10.1-3.5-10.1-9.5l0.1-50.5L501.7 66.9c3.8-2.6 7.9-4.3 12-4.9 4.1-0.6 8.2-0.1 12 1.5l371.4 186.6-0.1 50.5c0 6-4.6 11.6-10.2 12.4L139.5 418z" fill="#BBD2FF" p-id="1484"></path><path d="M800.1 104.9c4.3-0.6 7.9 2.7 7.9 7.3l-1 540.9c0 4.6-3.6 8.9-7.9 9.6L206.6 746c-4.3 0.6-7.9-2.7-7.9-7.3l1-540.9c0-4.7 3.6-8.9 7.9-9.6l592.5-83.3z" fill="#82A6FF" p-id="1485"></path><path d="M820.3 113.9c4.3-0.6 7.9 2.7 7.9 7.3l-1 540.9c0 4.6-3.6 8.9-7.9 9.6L226.8 755c-4.3 0.6-7.9-2.7-7.9-7.3l1-540.9c0-4.7 3.6-8.9 7.9-9.6l592.5-83.3z" fill="#344D66" p-id="1486"></path><path d="M264.7 218.2c4.4-0.6 7.9 2.7 7.9 7.4 0 4.8-3.5 9.1-7.9 9.7-4.4 0.6-7.9-2.7-7.9-7.5 0-4.6 3.5-8.9 7.9-9.6zM302.6 211.8c4.4-0.6 7.9 2.7 7.9 7.4 0 4.8-3.5 9.1-7.9 9.7s-7.9-2.7-7.9-7.5c0-4.6 3.5-8.9 7.9-9.6z" fill="#FF7777" p-id="1487"></path><path d="M340.4 206.5c4.4-0.6 7.9 2.7 7.9 7.4 0 4.8-3.5 9.1-7.9 9.7-4.4 0.6-7.9-2.7-7.9-7.5 0-4.7 3.5-9 7.9-9.6z" fill="#88FF8B" p-id="1488"></path><path d="M594.7 523.9l-22.5-12.3c-6.5-3.5-11.5-9.2-15.1-17l22.5 12.3c3.6 7.8 8.6 13.4 15.1 17" fill="#FFAFAF" p-id="1489"></path><path d="M592.2 478.6l22.5 12.3c0.2 0.1 0.3 0.2 0.5 0.3 0.9 0.4 1.9 0.8 3 1.1h0.2c1.5 0.4 3.2 0.6 5.1 0.7L601 480.6c-1.9-0.1-3.6-0.3-5.1-0.7-1.4-0.3-2.6-0.7-3.7-1.3zM640.2 310.9l-22.5-12.3c26.3 14.3 40.9 41.1 43.6 80.3-0.5 5.1-1.2 10-1.9 14.7-0.2 1.2-0.4 2.5-0.6 3.7-0.6 4.1-1.3 8-2.1 11.8-0.1 0.6-0.2 1.2-0.3 1.7-0.9 4.2-1.9 8.2-2.9 12-0.3 1-0.5 1.9-0.8 2.9-0.9 3.1-1.9 6.1-2.9 8.9-0.3 0.7-0.5 1.5-0.8 2.2-0.5 1.4-1.1 2.7-1.6 4.1-0.5 1.2-0.9 2.4-1.4 3.5-0.6 1.3-1.2 2.5-1.8 3.7l-1.5 3c-1.4 2.6-2.9 5-4.4 7.2l-1.5 2.1c-0.9 1.2-1.7 2.3-2.6 3.4-0.6 0.8-1.3 1.5-2 2.2-0.7 0.8-1.5 1.6-2.3 2.3-0.7 0.7-1.4 1.3-2.1 1.9-0.8 0.7-1.7 1.4-2.6 2-0.7 0.5-1.3 0.9-2 1.4-1.3 0.8-2.6 1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4.2 0.7 6.3 1.2z" fill="#FFAFAF" p-id="1491"></path><path d="M641.4 343.4L609 469.7c-3 15.2 1.9 22.9 14.6 23.2 1.5-0.1 3-0.2 4.5-0.4 28.5-4 46.6-33.7 54.3-89.3 1.1-8.2 1.3-16.7 0.1-24.9-8.7-58.4-48-84.7-117.9-78.9-5.2 0.4-10.5 1.4-15.5 2.9-82 24.1-124.9 82.5-128.8 175 2.8 71.2 44.2 104.4 124.2 99.4 2-0.2 4-0.4 6.1-0.7 22.7-3.2 47.5-12 74.4-26.4l10.2 33.3c-26.4 17.4-57.1 29.1-92.3 35.1-105.4 6.3-160.9-39.5-166.6-137.7 11.6-119.4 75.2-193.3 191-221.8 7.4-1.8 15.2-2.4 22.8-2.2 72.4 2.7 115.1 38.1 127.9 106.2 4.2 22.1 2.8 44.9-2.8 66.7-14.9 57.4-45.5 90.2-91.7 98.4-21.5 3-36.1-3.8-43.9-20.7-20.4 22-37.6 34-51.6 36-1.4 0.2-2.8 0.3-4.1 0.3-40 4.6-60-14.2-59.9-56.3 8.3-68.8 35.2-112.9 80.7-132.1 7.5-3.2 15.8-4.4 23.9-3.5 16 1.8 27 9 33.3 21.5l5.9-24.5 33.6-4.9z m-52.8 88c3-35.2-8.7-51.4-35-48.8-24.4 8.7-40.6 36.3-48.5 82.6-4 26.9 3.3 40.6 21.9 41.2 2.1 0 4.2-0.1 6.2-0.4 23.3-3.2 41.8-28.1 55.4-74.6" fill="#FFDCDC" p-id="1492"></path><path d="M603 257.2c1.5 0.2 3 0.3 4.6 0.5 2.6 0.3 5.1 0.7 7.5 1.1 1.5 0.2 3 0.5 4.4 0.8 2.5 0.5 4.9 1 7.2 1.6 1.3 0.3 2.6 0.6 3.8 0.9 4 1.1 7.9 2.2 11.6 3.6 0.6 0.2 1.2 0.5 1.8 0.7 3.2 1.2 6.2 2.5 9.2 3.9 2 0.9 4 1.9 5.9 2.9l-22.5-12.3c-1.4-0.8-2.9-1.5-4.3-2.2-0.5-0.2-1-0.4-1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 0.1 1.1 0.2 1.7 0.7 5.1 4.9 8.6 10 7.9l747.4-105c5.1-0.7 9.3-5.4 10-10.7 0.1-0.6 0.2-1.2 0.2-1.7l0.9-485.4-275.1 215z" fill="#D5E1FF" p-id="1494"></path><path d="M129.2 464.7l274.4 137.9-275.1 349.2c-0.1-0.6-0.2-1.1-0.2-1.7l0.9-485.4zM896.9 356.8l-0.9 485.4c0 0.6-0.1 1.2-0.2 1.7l-274-272.1 275.1-215z" fill="#BBD2FF" p-id="1495"></path><path d="M621.9 571.8l274 272.1c-0.7 5.3-4.9 10-10 10.7l-747.4 105c-5.1 0.7-9.2-2.8-10-7.9l275.1-349.2 218.3-30.7z" fill="#D5E1FF" p-id="1496"></path></svg>diff --git a/api/core/tools/provider/builtin/email/email.py b/api/core/tools/provider/builtin/email/email.pynew file mode 100644index 00000000000..182d8dac28e--- /dev/null+++ b/api/core/tools/provider/builtin/email/email.py@@ -0,0 +1,7 @@+from core.tools.provider.builtin.email.tools.send_mail import SendMailTool+from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController+++class SmtpProvider(BuiltinToolProviderController):+ def _validate_credentials(self, credentials: dict) -> None:+ SendMailTool()diff --git a/api/core/tools/provider/builtin/email/email.yaml b/api/core/tools/provider/builtin/email/email.yamlnew file mode 100644index 00000000000..bb1bb7f6f3e--- /dev/null+++ b/api/core/tools/provider/builtin/email/email.yaml@@ -0,0 +1,83 @@+identity:+ author: wakaka6+ name: email+ label:+ en_US: email+ zh_Hans: 电子邮件+ description:+ en_US: send email through smtp protocol+ zh_Hans: 通过smtp协议发送电子邮件+ icon: icon.svg+ tags:+ - utilities+credentials_for_provider:+ email_account:+ type: text-input+ required: true+ label:+ en_US: email account+ zh_Hans: 邮件账号+ placeholder:+ en_US: input you email account+ zh_Hans: 输入你的邮箱账号+ help:+ en_US: email account+ zh_Hans: 邮件账号+ email_password:+ type: secret-input+ required: true+ label:+ en_US: email password+ zh_Hans: 邮件密码+ placeholder:+ en_US: email password+ zh_Hans: 邮件密码+ help:+ en_US: email password+ zh_Hans: 邮件密码+ smtp_server:+ type: text-input+ required: true+ label:+ en_US: smtp server+ zh_Hans: 发信smtp服务器地址+ placeholder:+ en_US: smtp server+ zh_Hans: 发信smtp服务器地址+ help:+ en_US: smtp server+ zh_Hans: 发信smtp服务器地址+ smtp_port:+ type: text-input+ required: true+ label:+ en_US: smtp server port+ zh_Hans: 发信smtp服务器端口+ placeholder:+ en_US: smtp server port+ zh_Hans: 发信smtp服务器端口+ help:+ en_US: smtp server port+ zh_Hans: 发信smtp服务器端口+ encrypt_method:+ type: select+ required: true+ options:+ - value: NONE+ label:+ en_US: NONE+ zh_Hans: 无加密+ - value: SSL+ label:+ en_US: SSL+ zh_Hans: SSL加密+ - value: TLS+ label:+ en_US: START TLS+ zh_Hans: START TLS加密+ label:+ en_US: encrypt method+ zh_Hans: 加密方式+ help:+ en_US: smtp server encrypt method+ zh_Hans: 发信smtp服务器加密方式diff --git a/api/core/tools/provider/builtin/email/tools/send.py b/api/core/tools/provider/builtin/email/tools/send.pynew file mode 100644index 00000000000..35df574a414--- /dev/null+++ b/api/core/tools/provider/builtin/email/tools/send.py@@ -0,0 +1,53 @@+import logging+import smtplib+import ssl+from email.mime.multipart import MIMEMultipart+from email.mime.text import MIMEText++from pydantic import BaseModel+++class SendEmailToolParameters(BaseModel):+ smtp_server: str+ smtp_port: int++ email_account: str+ email_password: str++ sender_to: str+ subject: str+ email_content: str+ encrypt_method: str+++def send_mail(parmas: SendEmailToolParameters):+ timeout = 60+ msg = MIMEMultipart("alternative")+ msg["From"] = parmas.email_account+ msg["To"] = parmas.sender_to+ msg["Subject"] = parmas.subject+ msg.attach(MIMEText(parmas.email_content, "plain"))+ msg.attach(MIMEText(parmas.email_content, "html"))++ ctx = ssl.create_default_context()++ if parmas.encrypt_method.upper() == "SSL":+ try:+ with smtplib.SMTP_SSL(parmas.smtp_server, parmas.smtp_port, context=ctx, timeout=timeout) as server:+ server.login(parmas.email_account, parmas.email_password)+ server.sendmail(parmas.email_account, parmas.sender_to, msg.as_string())+ return True+ except Exception as e:+ logging.exception("send email failed: %s", e)+ return False+ else: # NONE or TLS+ try:+ with smtplib.SMTP(parmas.smtp_server, parmas.smtp_port, timeout=timeout) as server:+ if parmas.encrypt_method.upper() == "TLS":+ server.starttls(context=ctx)+ server.login(parmas.email_account, parmas.email_password)+ server.sendmail(parmas.email_account, parmas.sender_to, msg.as_string())+ return True+ except Exception as e:+ logging.exception("send email failed: %s", e)+ return Falsediff --git a/api/core/tools/provider/builtin/email/tools/send_mail.py b/api/core/tools/provider/builtin/email/tools/send_mail.pynew file mode 100644index 00000000000..d51d5439b78--- /dev/null+++ b/api/core/tools/provider/builtin/email/tools/send_mail.py@@ -0,0 +1,66 @@+import re+from typing import Any, Union++from core.tools.entities.tool_entities import ToolInvokeMessage+from core.tools.provider.builtin.email.tools.send import (+ SendEmailToolParameters,+ send_mail,+)+from core.tools.tool.builtin_tool import BuiltinTool+++class SendMailTool(BuiltinTool):+ def _invoke(+ self, user_id: str, tool_parameters: dict[str, Any]+ ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:+ """+ invoke tools+ """+ sender = self.runtime.credentials.get("email_account", "")+ email_rgx = re.compile(r"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$")+ password = self.runtime.credentials.get("email_password", "")+ smtp_server = self.runtime.credentials.get("smtp_server", "")+ if not smtp_server:+ return self.create_text_message("please input smtp server")+ smtp_port = self.runtime.credentials.get("smtp_port", "")+ try:+ smtp_port = int(smtp_port)+ except ValueError:+ return self.create_text_message("Invalid parameter smtp_port(should be int)")++ if not sender:+ return self.create_text_message("please input sender")+ if not email_rgx.match(sender):+ return self.create_text_message("Invalid parameter userid, the sender is not a mailbox")++ receiver_email = tool_parameters["send_to"]+ if not receiver_email:+ return self.create_text_message("please input receiver email")+ if not email_rgx.match(receiver_email):+ return self.create_text_message("Invalid parameter receiver email, the receiver email is not a mailbox")+ email_content = tool_parameters.get("email_content", "")++ if not email_content:+ return self.create_text_message("please input email content")++ subject = tool_parameters.get("subject", "")+ if not subject:+ return self.create_text_message("please input email subject")++ encrypt_method = self.runtime.credentials.get("encrypt_method", "")+ if not encrypt_method:+ return self.create_text_message("please input encrypt method")++ send_email_params = SendEmailToolParameters(+ smtp_server=smtp_server,+ smtp_port=smtp_port,+ email_account=sender,+ email_password=password,+ sender_to=receiver_email,+ subject=subject,+ email_content=email_content,+ encrypt_method=encrypt_method,+ )+ if send_mail(send_email_params):+ return self.create_text_message("send email success")+ return self.create_text_message("send email failed")diff --git a/api/core/tools/provider/builtin/email/tools/send_mail.yaml b/api/core/tools/provider/builtin/email/tools/send_mail.yamlnew file mode 100644index 00000000000..f54880bf3e9--- /dev/null+++ b/api/core/tools/provider/builtin/email/tools/send_mail.yaml@@ -0,0 +1,46 @@+identity:+ name: send_mail+ author: wakaka6+ label:+ en_US: send email+ zh_Hans: 发送邮件+ icon: icon.svg+description:+ human:+ en_US: A tool for sending email+ zh_Hans: 用于发送邮件+ llm: A tool for sending email+parameters:+ - name: send_to+ type: string+ required: true+ label:+ en_US: Recipient email account+ zh_Hans: 收件人邮箱账号+ human_description:+ en_US: Recipient email account+ zh_Hans: 收件人邮箱账号+ llm_description: Recipient email account+ form: llm+ - name: subject+ type: string+ required: true+ label:+ en_US: email subject+ zh_Hans: 邮件主题+ human_description:+ en_US: email subject+ zh_Hans: 邮件主题+ llm_description: email subject+ form: llm+ - name: email_content+ type: string+ required: true+ label:+ en_US: email content+ zh_Hans: 邮件内容+ human_description:+ en_US: email content+ zh_Hans: 邮件内容+ llm_description: email content+ form: llmdiff --git a/api/core/tools/provider/builtin/email/tools/send_mail_batch.py b/api/core/tools/provider/builtin/email/tools/send_mail_batch.pynew file mode 100644index 00000000000..ff7e1769901--- /dev/null+++ b/api/core/tools/provider/builtin/email/tools/send_mail_batch.py@@ -0,0 +1,75 @@+import json+import re+from typing import Any, Union++from core.tools.entities.tool_entities import ToolInvokeMessage+from core.tools.provider.builtin.email.tools.send import (+ SendEmailToolParameters,+ send_mail,+)+from core.tools.tool.builtin_tool import BuiltinTool+++class SendMailTool(BuiltinTool):+ def _invoke(+ self, user_id: str, tool_parameters: dict[str, Any]+ ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:+ """+ invoke tools+ """+ sender = self.runtime.credentials.get("email_account", "")+ email_rgx = re.compile(r"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$")+ password = self.runtime.credentials.get("email_password", "")+ smtp_server = self.runtime.credentials.get("smtp_server", "")+ if not smtp_server:+ return self.create_text_message("please input smtp server")+ smtp_port = self.runtime.credentials.get("smtp_port", "")+ try:+ smtp_port = int(smtp_port)+ except ValueError:+ return self.create_text_message("Invalid parameter smtp_port(should be int)")++ if not sender:+ return self.create_text_message("please input sender")+ if not email_rgx.match(sender):+ return self.create_text_message("Invalid parameter userid, the sender is not a mailbox")++ receivers_email = tool_parameters["send_to"]+ if not receivers_email:+ return self.create_text_message("please input receiver email")+ receivers_email = json.loads(receivers_email)+ for receiver in receivers_email:+ if not email_rgx.match(receiver):+ return self.create_text_message(+ f"Invalid parameter receiver email, the receiver email({receiver}) is not a mailbox"+ )+ email_content = tool_parameters.get("email_content", "")++ if not email_content:+ return self.create_text_message("please input email content")++ subject = tool_parameters.get("subject", "")+ if not subject:+ return self.create_text_message("please input email subject")++ encrypt_method = self.runtime.credentials.get("encrypt_method", "")+ if not encrypt_method:+ return self.create_text_message("please input encrypt method")++ msg = {}+ for receiver in receivers_email:+ send_email_params = SendEmailToolParameters(+ smtp_server=smtp_server,+ smtp_port=smtp_port,+ email_account=sender,+ email_password=password,+ sender_to=receiver,+ subject=subject,+ email_content=email_content,+ encrypt_method=encrypt_method,+ )+ if send_mail(send_email_params):+ msg[receiver] = "send email success"+ else:+ msg[receiver] = "send email failed"+ return self.create_text_message(json.dumps(msg))diff --git a/api/core/tools/provider/builtin/email/tools/send_mail_batch.yaml b/api/core/tools/provider/builtin/email/tools/send_mail_batch.yamlnew file mode 100644index 00000000000..6e4aa785cb9--- /dev/null+++ b/api/core/tools/provider/builtin/email/tools/send_mail_batch.yaml@@ -0,0 +1,46 @@+identity:+ name: send_mail_batch+ author: wakaka6+ label:+ en_US: send email to multiple recipients+ zh_Hans: 发送邮件给多个收件人+ icon: icon.svg+description:+ human:+ en_US: A tool for sending email to multiple recipients+ zh_Hans: 用于发送邮件给多个收件人的工具+ llm: A tool for sending email to multiple recipients+parameters:+ - name: send_to+ type: string+ required: true+ label:+ en_US: Recipient email account(json list)+ zh_Hans: 收件人邮箱账号(json list)+ human_description:+ en_US: Recipient email account+ zh_Hans: 收件人邮箱账号+ llm_description: A list of recipient email account(json format)+ form: llm+ - name: subject+ type: string+ required: true+ label:+ en_US: email subject+ zh_Hans: 邮件主题+ human_description:+ en_US: email subject+ zh_Hans: 邮件主题+ llm_description: email subject+ form: llm+ - name: email_content+ type: string+ required: true+ label:+ en_US: email content+ zh_Hans: 邮件内容+ human_description:+ en_US: email content+ zh_Hans: 邮件内容+ llm_description: email content+ form: llm