Skip to content

Commit 53821d1

Browse files
author
Jicheng Lu
committed
refine handle email request prompt
1 parent fa7e387 commit 53821d1

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/Plugins/BotSharp.Plugin.EmailHandler/Functions/HandleEmailRequestFn.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public async Task<bool> Execute(RoleDialogModel message)
5656
}
5757

5858
mailMessage.Body = bodyBuilder.ToMessageBody();
59-
var response = await HandleSendEmailBySMTP(mailMessage);
59+
var response = await SendEmailBySMTP(mailMessage);
6060
message.Content = response;
6161

6262
_logger.LogWarning($"Email successfully send over to {recipient}. Email Subject: {subject} [{response}]");
@@ -140,7 +140,7 @@ private void BuildEmailAttachments(BodyBuilder builder, IEnumerable<MessageFileM
140140
}
141141
}
142142

143-
private async Task<string> HandleSendEmailBySMTP(MimeMessage mailMessage)
143+
private async Task<string> SendEmailBySMTP(MimeMessage mailMessage)
144144
{
145145
using var smtpClient = new SmtpClient();
146146
await smtpClient.ConnectAsync(_emailSettings.SMTPServer, _emailSettings.SMTPPort, SecureSocketOptions.StartTls);

src/Plugins/BotSharp.Plugin.EmailHandler/data/agents/6745151e-6d46-4a02-8de4-1c4f21c7da95/functions/handle_email_request.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "handle_email_request",
3-
"description": "If the user requests to send an email, you need to capture the email content and the recipient email address. If the user explicitly enter email subject use the same if not intelligently capture the email subject from the content. Then call this function to send out email.",
3+
"description": "If the user requests to send an email with or without attachments or files, you need to capture the email content and the recipient email address. If the user explicitly enter email subject use the same if not intelligently capture the email subject from the content. Then call this function to send out email.",
44
"parameters": {
55
"type": "object",
66
"properties": {
@@ -18,7 +18,7 @@
1818
},
1919
"is_need_attachments": {
2020
"type": "boolean",
21-
"description": "If the user request to send email with attachemnt(s), then this value should be true. Otherwise, this value should be false."
21+
"description": "If the user request to send email with attachemnt(s) or file(s), then this value should be True. Otherwise, this value should be False."
2222
}
2323
},
2424
"required": [ "to_address", "email_content", "subject", "is_need_attachments" ]
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Suppose user has uploaded some attachments.
21
Please call handle_email_request if user wants to send out an email.

0 commit comments

Comments
 (0)