Skip to content

Commit bf9e2fa

Browse files
committed
Added support for qwen
1 parent 6829ab5 commit bf9e2fa

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

background.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ async function getPrompt(content) {
163163
return await getPhiPrompt(content)
164164
}
165165

166+
if (model.startsWith("qwen")) {
167+
return await getQwenPrompt(content)
168+
}
169+
166170
return await getLlamaPrompt(content)
167171
}
168172

@@ -193,6 +197,19 @@ async function getLlamaPrompt(content) {
193197
"<|start_header_id|>assistant<|end_header_id|>"
194198
}
195199

200+
async function getQwenPrompt(content) {
201+
return "<|im_start|>system\n" +
202+
"You are an expert in reading and summarizing emails." +
203+
"<|im_end|>" +
204+
"<|im_start|>system\n" +
205+
"The email content is: " + content +
206+
"<|im_end|>" +
207+
"<|im_start|>user\n" +
208+
await getInstructions() +
209+
"<|im_end|>" +
210+
"<|im_start|>assistant"
211+
}
212+
196213
/**
197214
* Call Ollama to generate a summary of the email
198215
* @param content The plain text context of the email

options.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<option value="llama3.2">llama3.2</option>
4545
<option value="llama3.3">llama3.3</option>
4646
<option value="phi4">phi4</option>
47+
<option value="qwen2.5">qwen2.5</option>
4748
</select>
4849
<p>This is the model used to summarize the email. These models must be
4950
pulled by Ollama with the command "ollama pull &lt;modelname&gt;".</p>

0 commit comments

Comments
 (0)