feat: Implement code changes to enhance functionality and improve performance

This commit is contained in:
2025-05-29 16:28:59 +02:00
parent d8dc7818e5
commit 8637827f2f
2 changed files with 10 additions and 1 deletions

View File

@@ -88,7 +88,16 @@ func (a *AI) GenerateReply(emailContent string, contextContent map[string]string
} }
// Prepare the system message with language-specific instruction // Prepare the system message with language-specific instruction
systemMsg := fmt.Sprintf("You are a helpful assistant who responds to emails.Regardless of the language used in the email content or context, your response must be entirely in %s. Format your reply solely in HTML using appropriate HTML tags for structure and styling. Do not include a subject line, explanations, commentary, or any extra text.", lang) systemMsg := fmt.Sprintf(`You are a helpful assistant who responds to emails.
Your primary goal is to answer the user's query based on the provided email and context.
Instructions:
- Language: Your response must be entirely in %s, regardless of the language used in the email content or context.
- Format: Your reply must be raw HTML. Use appropriate HTML tags for structure and styling.
- Markdown: Do NOT wrap the HTML in markdown code blocks (e.g., %s).
- Extraneous Text: Do not include a subject line. Do not include explanations, commentary, or any extra text that is not part of the direct answer.
- Closing: Avoid generic closing statements like "If you have further questions...". Focus solely on answering the email.
`, lang, "```html ... ```")
logger.WithFields(logrus.Fields{ logger.WithFields(logrus.Fields{
"systemprompt": systemMsg, "systemprompt": systemMsg,
}).Debug("Generating system prompt") }).Debug("Generating system prompt")

BIN
main Executable file

Binary file not shown.