Skip to content

Commit 45e3ad6

Browse files
authored
feat(ChatOllama): add 'think' input option for reasoning support (#6116)
1 parent 76c4fc9 commit 45e3ad6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/components/nodes/chatmodels/ChatOllama/ChatOllama.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ class ChatOllama_ChatModels implements INode {
7979
default: false,
8080
optional: true
8181
},
82+
{
83+
label: 'Think',
84+
name: 'think',
85+
type: 'boolean',
86+
description: 'Whether the model supports reasoning. Only applicable for reasoning models',
87+
default: false,
88+
optional: true
89+
},
8290
{
8391
label: 'JSON Mode',
8492
name: 'jsonMode',
@@ -240,6 +248,7 @@ class ChatOllama_ChatModels implements INode {
240248
const allowImageUploads = nodeData.inputs?.allowImageUploads as boolean
241249
const jsonMode = nodeData.inputs?.jsonMode as boolean
242250
const streaming = nodeData.inputs?.streaming as boolean
251+
const think = nodeData.inputs?.think as boolean
243252

244253
const cache = nodeData.inputs?.cache as BaseCache
245254

@@ -265,6 +274,9 @@ class ChatOllama_ChatModels implements INode {
265274
if (cache) obj.cache = cache
266275
if (jsonMode) obj.format = 'json'
267276

277+
if (think === true) obj.think = true
278+
else obj.think = false
279+
268280
const multiModalOption: IMultiModalOption = {
269281
image: {
270282
allowImageUploads: allowImageUploads ?? false

0 commit comments

Comments
 (0)