Fix Ollama thinking mode with /nothink chat message

Send /nothink as a separate message before the actual prompt,
with a mock assistant response. This properly disables thinking
mode for Qwen3/DeepSeek models.

Removed the ineffective think:false API parameter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
clucraft 2026-01-25 19:40:02 -05:00
parent aad5a797b6
commit f1a055c3b9

View file

@ -286,13 +286,20 @@ async function extractWithOllama(
{ {
model: model, model: model,
messages: [ messages: [
{
role: 'user',
content: '/nothink', // Disable thinking mode for Qwen3/DeepSeek
},
{
role: 'assistant',
content: 'Ok.',
},
{ {
role: 'user', role: 'user',
content: EXTRACTION_PROMPT + preparedHtml, content: EXTRACTION_PROMPT + preparedHtml,
}, },
], ],
stream: false, stream: false,
think: false, // Disable thinking mode for Qwen3/DeepSeek models
options: { options: {
num_ctx: 16384, // Increase context window for large HTML content num_ctx: 16384, // Increase context window for large HTML content
}, },
@ -388,9 +395,12 @@ async function verifyWithOllama(
`${baseUrl}/api/chat`, `${baseUrl}/api/chat`,
{ {
model: model, model: model,
messages: [{ role: 'user', content: prompt }], messages: [
{ role: 'user', content: '/nothink' },
{ role: 'assistant', content: 'Ok.' },
{ role: 'user', content: prompt },
],
stream: false, stream: false,
think: false, // Disable thinking mode for Qwen3/DeepSeek models
options: { options: {
num_ctx: 16384, // Increase context window for large HTML content num_ctx: 16384, // Increase context window for large HTML content
}, },
@ -484,9 +494,12 @@ async function verifyStockStatusWithOllama(
`${baseUrl}/api/chat`, `${baseUrl}/api/chat`,
{ {
model: model, model: model,
messages: [{ role: 'user', content: prompt }], messages: [
{ role: 'user', content: '/nothink' },
{ role: 'assistant', content: 'Ok.' },
{ role: 'user', content: prompt },
],
stream: false, stream: false,
think: false, // Disable thinking mode for Qwen3/DeepSeek models
options: { options: {
num_ctx: 16384, // Increase context window for large HTML content num_ctx: 16384, // Increase context window for large HTML content
}, },
@ -943,9 +956,12 @@ async function arbitrateWithOllama(
`${baseUrl}/api/chat`, `${baseUrl}/api/chat`,
{ {
model: model, model: model,
messages: [{ role: 'user', content: prompt }], messages: [
{ role: 'user', content: '/nothink' },
{ role: 'assistant', content: 'Ok.' },
{ role: 'user', content: prompt },
],
stream: false, stream: false,
think: false, // Disable thinking mode for Qwen3/DeepSeek models
options: { options: {
num_ctx: 16384, // Increase context window for large HTML content num_ctx: 16384, // Increase context window for large HTML content
}, },