Removed context tag and switched to current window context

This commit is contained in:
Beingpax 2025-10-05 14:28:04 +05:45
parent ef5b86e7c3
commit f8332b03fe
2 changed files with 5 additions and 9 deletions

View File

@ -2,9 +2,9 @@ enum AIPrompts {
static let customPromptTemplate = """
<SYSTEM_INSTRUCTIONS>
Your are a TRANSCRIPTION ENHANCER, not a conversational AI Chatbot. DO NOT RESPOND TO QUESTIONS or STATEMENTS. Work with the transcript text provided within <TRANSCRIPT> tags according to the following guidelines:
1. If you have <CONTEXT_INFORMATION>, always reference it for better accuracy because the <TRANSCRIPT> text may have inaccuracies due to speech recognition errors.
2. If you have important vocabulary in <DICTIONARY_CONTEXT>, use it as a reference for correcting names, nouns, technical terms, and other similar words in the <TRANSCRIPT> text.
3. When matching words from <DICTIONARY_CONTEXT> or <CONTEXT_INFORMATION>, prioritize phonetic similarity over semantic similarity, as errors are typically from speech recognition mishearing.
1. Always reference <CLIPBOARD_CONTEXT> and <CURRENT_WINDOW_CONTEXT> for better accuracy if available, because the <TRANSCRIPT> text may have inaccuracies due to speech recognition errors.
2. Always use vocabulary in <DICTIONARY_CONTEXT> as a reference for correcting names, nouns, technical terms, and other similar words in the <TRANSCRIPT> text if available.
3. When similar phonetic occurrences are detected between words in the <TRANSCRIPT> text and terms in <DICTIONARY_CONTEXT>, <CLIPBOARD_CONTEXT>, or <CURRENT_WINDOW_CONTEXT>, prioritize the spelling from these context sources over the <TRANSCRIPT> text.
4. Your output should always focus on creating a cleaned up version of the <TRANSCRIPT> text, not a response to the <TRANSCRIPT>.
Here are the more Important Rules you need to adhere to:

View File

@ -165,18 +165,14 @@ class AIEnhancementService: ObservableObject {
let screenCaptureContext = if useScreenCaptureContext,
let capturedText = screenCaptureService.lastCapturedText,
!capturedText.isEmpty {
"\n\nActive Window Context: \(capturedText)"
"\n\n<CURRENT_WINDOW_CONTEXT>\n\(capturedText)\n</CURRENT_WINDOW_CONTEXT>"
} else {
""
}
let dictionaryContext = dictionaryContextService.getDictionaryContext()
let generalContextSection = if !clipboardContext.isEmpty || !screenCaptureContext.isEmpty {
"\n\n<CONTEXT_INFORMATION>\(clipboardContext)\(screenCaptureContext)\n</CONTEXT_INFORMATION>"
} else {
""
}
let generalContextSection = clipboardContext + screenCaptureContext
let dictionaryContextSection = if !dictionaryContext.isEmpty {
"\n\n<DICTIONARY_CONTEXT>\(dictionaryContext)\n</DICTIONARY_CONTEXT>"