From 7bdf2036c60e50ab7a15eb01c3d6a8ebae971ef4 Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Tue, 17 Jun 2025 21:38:56 -0500 Subject: [PATCH] Remove operator parameter --- _locales/en-US/messages.json | 2 +- modules/ExpressionSearchFilter.jsm | 5 ++--- options/options.html | 2 +- prompt_templates/mistral.txt | 3 ++- prompt_templates/openai.txt | 3 ++- prompt_templates/qwen.txt | 3 ++- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/_locales/en-US/messages.json b/_locales/en-US/messages.json index 2aeebef..54882db 100644 --- a/_locales/en-US/messages.json +++ b/_locales/en-US/messages.json @@ -8,7 +8,7 @@ "options.customTemplate": { "message": "Custom template" }, "options.systemInstructions": { "message": "System instructions" }, "options.reset": { "message": "Reset to default" }, - "options.placeholders": { "message": "Placeholders: {{system}}, {{email}}, {{operator}}, {{query}}" }, + "options.placeholders": { "message": "Placeholders: {{system}}, {{email}}, {{query}}" }, "template.openai": { "message": "OpenAI / ChatML" }, "template.qwen": { "message": "Qwen" }, "template.mistral": { "message": "Mistral" }, diff --git a/modules/ExpressionSearchFilter.jsm b/modules/ExpressionSearchFilter.jsm index d2468a4..694225c 100644 --- a/modules/ExpressionSearchFilter.jsm +++ b/modules/ExpressionSearchFilter.jsm @@ -156,12 +156,11 @@ function buildSystemPrompt() { return SYSTEM_PREFIX + (gCustomSystemPrompt || DEFAULT_CUSTOM_SYSTEM_PROMPT) + SYSTEM_SUFFIX; } -function buildPrompt(body, criterion, opName) { +function buildPrompt(body, criterion) { console.log(`[ai-filter][ExpressionSearchFilter] Building prompt with criterion: "${criterion}"`); const data = { system: buildSystemPrompt(), email: body, - operator: opName, query: criterion, }; let template = gTemplateText || loadTemplate(gTemplateName); @@ -189,7 +188,7 @@ class ClassificationTerm extends CustomerTermBase { let body = getPlainText(msgHdr); let payload = JSON.stringify({ - prompt: buildPrompt(body, value, opName), + prompt: buildPrompt(body, value), max_tokens: 4096, temperature: 0.6, top_p: 0.95, diff --git a/options/options.html b/options/options.html index 992fc1d..b0c5a78 100644 --- a/options/options.html +++ b/options/options.html @@ -132,7 +132,7 @@
diff --git a/prompt_templates/mistral.txt b/prompt_templates/mistral.txt index 4eb1f4b..21a2fac 100644 --- a/prompt_templates/mistral.txt +++ b/prompt_templates/mistral.txt @@ -3,5 +3,6 @@ Email: {{email}} -Criterion ({{operator}}): {{query}} +Criterion: {{query}} +Remember to ONLY return the JSON object described in the system instructions. [/INST] diff --git a/prompt_templates/openai.txt b/prompt_templates/openai.txt index 2088d8e..b6b142e 100644 --- a/prompt_templates/openai.txt +++ b/prompt_templates/openai.txt @@ -5,5 +5,6 @@ ``` {{email}} ``` -Classification Criterion ({{operator}}): {{query}}<|im_end|> +Classification Criterion: {{query}} +Remember to ONLY return the JSON object described in the system instructions.<|im_end|> <|im_start|>assistant diff --git a/prompt_templates/qwen.txt b/prompt_templates/qwen.txt index ca18018..4a23068 100644 --- a/prompt_templates/qwen.txt +++ b/prompt_templates/qwen.txt @@ -5,6 +5,7 @@ Email: {{email}} -Criterion ({{operator}}): {{query}} +Criterion: {{query}} +Remember to ONLY return the JSON object described in the system instructions. <|im_end|> <|im_start|>assistant