updated system message

This commit is contained in:
Beingpax 2025-08-02 15:00:35 +05:45
parent cfd09ed36b
commit b53f6eeb63
2 changed files with 6 additions and 14 deletions

View File

@ -2,12 +2,12 @@ enum AIPrompts {
static let customPromptTemplate = """
<SYSTEM_INSTRUCTIONS>
Your task is to reformat and enhance the text provided within <TRANSCRIPT> tags according to the following guidelines:
The information in <CONTEXT_INFORMATION> section is ONLY for reference.
1. If you have <CONTEXT_INFORMATION>, always reference it for better accuracy because the <TRANSCRIPT> may have inaccuracies due to speech recognition errors.
2. Use the <CONTEXT_INFORMATION> as a reference for correcting the names, nouns, file names, and technical terms in the <TRANSCRIPT>.
%@
IMPORTANT: The input will be wrapped in <TRANSCRIPT> tags to identify what needs enhancement.
Your response should ONLY be to enhance text WITHOUT any tags.
DO NOT include <TRANSCRIPT> tags in your response.
</SYSTEM_INSTRUCTIONS>
"""
@ -26,13 +26,5 @@ enum AIPrompts {
</SYSTEM_INSTRUCTIONS>
"""
static let contextInstructions = """
<CONTEXT_USAGE_INSTRUCTIONS>
Your task is to work ONLY with the content within the <TRANSCRIPT> tags.
IMPORTANT: The information in <CONTEXT_INFORMATION> section is ONLY for reference.
- If the <TRANSCRIPT> & <CONTEXT_INFORMATION> contains similar looking names, nouns, company names, or usernames, prioritize the spelling and form from the <CONTEXT_INFORMATION> section, as the <TRANSCRIPT> may contain errors during transcription.
- Use the <CONTEXT_INFORMATION> to understand the user's intent and context.
</CONTEXT_USAGE_INSTRUCTIONS>
"""
}

View File

@ -126,7 +126,7 @@ class AIEnhancementService: ObservableObject {
let selectedText = selectedText, !selectedText.isEmpty {
let selectedTextContext = "\n\nSelected Text: \(selectedText)"
let contextSection = "\n\n\(AIPrompts.contextInstructions)\n\n<CONTEXT_INFORMATION>\(selectedTextContext)\n</CONTEXT_INFORMATION>"
let contextSection = "\n\n<CONTEXT_INFORMATION>\(selectedTextContext)\n</CONTEXT_INFORMATION>"
return activePrompt.promptText + contextSection
}
@ -147,7 +147,7 @@ class AIEnhancementService: ObservableObject {
}
let contextSection = if !clipboardContext.isEmpty || !screenCaptureContext.isEmpty {
"\n\n\(AIPrompts.contextInstructions)\n\n<CONTEXT_INFORMATION>\(clipboardContext)\(screenCaptureContext)\n</CONTEXT_INFORMATION>"
"\n\n<CONTEXT_INFORMATION>\(clipboardContext)\(screenCaptureContext)\n</CONTEXT_INFORMATION>"
} else {
""
}