diff --git a/internal/ai/ai.go b/internal/ai/ai.go index 6f1e38f..6893aba 100644 --- a/internal/ai/ai.go +++ b/internal/ai/ai.go @@ -88,7 +88,16 @@ func (a *AI) GenerateReply(emailContent string, contextContent map[string]string } // 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{ "systemprompt": systemMsg, }).Debug("Generating system prompt") diff --git a/main b/main new file mode 100755 index 0000000..8242da6 Binary files /dev/null and b/main differ