refine handle email request prompt

This commit is contained in:
Jicheng Lu 2024-07-17 22:00:00 -05:00
parent fa7e387ae9
commit 53821d12d7
3 changed files with 4 additions and 5 deletions

View file

@ -56,7 +56,7 @@ public class HandleEmailRequestFn : IFunctionCallback
}
mailMessage.Body = bodyBuilder.ToMessageBody();
var response = await HandleSendEmailBySMTP(mailMessage);
var response = await SendEmailBySMTP(mailMessage);
message.Content = response;
_logger.LogWarning($"Email successfully send over to {recipient}. Email Subject: {subject} [{response}]");
@ -140,7 +140,7 @@ public class HandleEmailRequestFn : IFunctionCallback
}
}
private async Task<string> HandleSendEmailBySMTP(MimeMessage mailMessage)
private async Task<string> SendEmailBySMTP(MimeMessage mailMessage)
{
using var smtpClient = new SmtpClient();
await smtpClient.ConnectAsync(_emailSettings.SMTPServer, _emailSettings.SMTPPort, SecureSocketOptions.StartTls);

View file

@ -1,6 +1,6 @@
{
"name": "handle_email_request",
"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.",
"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.",
"parameters": {
"type": "object",
"properties": {
@ -18,7 +18,7 @@
},
"is_need_attachments": {
"type": "boolean",
"description": "If the user request to send email with attachemnt(s), then this value should be true. Otherwise, this value should be false."
"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."
}
},
"required": [ "to_address", "email_content", "subject", "is_need_attachments" ]

View file

@ -1,2 +1 @@
Suppose user has uploaded some attachments.
Please call handle_email_request if user wants to send out an email.