From 6d169e1b8cc2c244e1603636120aa340f99a67c6 Mon Sep 17 00:00:00 2001 From: wagesj45 Date: Wed, 7 Jan 2026 13:39:02 -0600 Subject: [PATCH] Add harmony prompt template --- AGENTS.md | 2 +- README.md | 2 +- _locales/en-US/messages.json | 1 + ai-filter.sln | 1 + options/options.js | 1 + prompt_templates/harmony.txt | 21 +++++++++++++++++++++ 6 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 prompt_templates/harmony.txt diff --git a/AGENTS.md b/AGENTS.md index 5f5f2f6..3e3cba4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,7 +10,7 @@ This file provides guidelines for codex agents contributing to the Sortana proje - `options/`: The options page HTML, JavaScript and bundled Bulma CSS (v1.0.3). - `details.html` and `details.js`: View AI reasoning and clear cache for a message. - `resources/`: Images and other static files. -- `prompt_templates/`: Prompt template files for the AI service. +- `prompt_templates/`: Prompt template files for the AI service (openai, qwen, mistral, harmony). - `build-xpi.ps1`: PowerShell script to package the extension. - `build-xpi.sh`: Bash script to package the extension. diff --git a/README.md b/README.md index aec6884..8779d1a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ expecting a `match` (or `matched`) boolean plus a `reason` string. ## Features - **Configurable endpoint** – set the classification service base URL on the options page. -- **Prompt templates** – choose between several model formats or provide your own custom template. +- **Prompt templates** – choose between OpenAI/ChatML, Qwen, Mistral, Harmony (gpt-oss), or provide your own custom template. - **Custom system prompts** – tailor the instructions sent to the model for more precise results. - **Persistent result caching** – classification results and reasoning are saved to disk so messages aren't re-evaluated across restarts. - **Advanced parameters** – tune generation settings like temperature, top‑p and more from the options page. diff --git a/_locales/en-US/messages.json b/_locales/en-US/messages.json index 65181c8..017e1a3 100644 --- a/_locales/en-US/messages.json +++ b/_locales/en-US/messages.json @@ -12,6 +12,7 @@ "template.openai": { "message": "OpenAI / ChatML" }, "template.qwen": { "message": "Qwen" }, "template.mistral": { "message": "Mistral" }, + "template.harmony": { "message": "Harmony (gpt-oss)" }, "template.custom": { "message": "Custom" }, "options.save": { "message": "Save" }, "options.debugLogging": { "message": "Enable debug logging" }, diff --git a/ai-filter.sln b/ai-filter.sln index ea71f1b..7ded341 100644 --- a/ai-filter.sln +++ b/ai-filter.sln @@ -44,6 +44,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "prompt_templates", "prompt_ prompt_templates\mistral.txt = prompt_templates\mistral.txt prompt_templates\openai.txt = prompt_templates\openai.txt prompt_templates\qwen.txt = prompt_templates\qwen.txt + prompt_templates\harmony.txt = prompt_templates\harmony.txt EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{68A87938-5C2B-49F5-8AAA-8A34FBBFD854}" diff --git a/options/options.js b/options/options.js index d905d7d..860c944 100644 --- a/options/options.js +++ b/options/options.js @@ -104,6 +104,7 @@ document.addEventListener('DOMContentLoaded', async () => { openai: browser.i18n.getMessage('template.openai'), qwen: browser.i18n.getMessage('template.qwen'), mistral: browser.i18n.getMessage('template.mistral'), + harmony: browser.i18n.getMessage('template.harmony'), custom: browser.i18n.getMessage('template.custom') }; const templateSelect = document.getElementById('template'); diff --git a/prompt_templates/harmony.txt b/prompt_templates/harmony.txt new file mode 100644 index 0000000..5054543 --- /dev/null +++ b/prompt_templates/harmony.txt @@ -0,0 +1,21 @@ +<|start|>system<|message|>You are ChatGPT, a large language model trained by OpenAI. +Knowledge cutoff: 2024-06 +Current date: 2025-06-28 + +Reasoning: medium + +# Valid channels: analysis, commentary, final. Channel must be included for every message.<|end|> +<|start|>developer<|message|># Instructions + +{{system}}<|end|> +<|start|>user<|message|>**Email Contents** +``` +{{email}} +``` +Classification Criterion: {{query}} +Remember, return ONLY a JSON object on a single line of the form: +{"match": true, "reason": ""} - if the email satisfies the criterion +{"match": false, "reason": ""} - otherwise + +Do not add any other keys, text, or formatting.<|end|> +<|start|>assistant