mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-04-25 00:36:32 +02:00
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:
parent
aad5a797b6
commit
f1a055c3b9
1 changed files with 23 additions and 7 deletions
|
|
@ -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
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue