Skip to content

Commit 768de61

Browse files
feat: add thinking budget parameter support for ChatGoogleVertexAI (#4557)
* chore: update @langchain/google-vertexai add thinkingBudget parameter support * Update pnpm-lock.yaml * Update pnpm-lock.yaml --------- Co-authored-by: Henry <[email protected]> Co-authored-by: Henry Heng <[email protected]>
1 parent 0627693 commit 768de61

File tree

3 files changed

+102
-40
lines changed

3 files changed

+102
-40
lines changed

packages/components/nodes/chatmodels/ChatGoogleVertexAI/ChatGoogleVertexAI.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class GoogleVertexAI_ChatModels implements INode {
6565
constructor() {
6666
this.label = 'ChatGoogleVertexAI'
6767
this.name = 'chatGoogleVertexAI'
68-
this.version = 5.1
68+
this.version = 5.2
6969
this.type = 'ChatGoogleVertexAI'
7070
this.icon = 'GoogleVertex.svg'
7171
this.category = 'Chat Models'
@@ -151,6 +151,16 @@ class GoogleVertexAI_ChatModels implements INode {
151151
step: 1,
152152
optional: true,
153153
additionalParams: true
154+
},
155+
{
156+
label: 'Thinking Budget',
157+
name: 'thinkingBudget',
158+
type: 'number',
159+
description: 'Number of tokens to use for thinking process (0 to disable)',
160+
step: 1,
161+
placeholder: '1024',
162+
optional: true,
163+
additionalParams: true
154164
}
155165
]
156166
}
@@ -192,6 +202,7 @@ class GoogleVertexAI_ChatModels implements INode {
192202
const cache = nodeData.inputs?.cache as BaseCache
193203
const topK = nodeData.inputs?.topK as string
194204
const streaming = nodeData.inputs?.streaming as boolean
205+
const thinkingBudget = nodeData.inputs?.thinkingBudget as string
195206

196207
const allowImageUploads = nodeData.inputs?.allowImageUploads as boolean
197208

@@ -211,6 +222,7 @@ class GoogleVertexAI_ChatModels implements INode {
211222
if (topP) obj.topP = parseFloat(topP)
212223
if (cache) obj.cache = cache
213224
if (topK) obj.topK = parseFloat(topK)
225+
if (thinkingBudget) obj.thinkingBudget = parseInt(thinkingBudget, 10)
214226

215227
const model = new ChatVertexAI(nodeData.id, obj)
216228
model.setMultiModalOption(multiModalOption)

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@langchain/core": "0.3.61",
4646
"@langchain/exa": "^0.0.5",
4747
"@langchain/google-genai": "0.2.3",
48-
"@langchain/google-vertexai": "^0.2.0",
48+
"@langchain/google-vertexai": "^0.2.10",
4949
"@langchain/groq": "0.1.2",
5050
"@langchain/langgraph": "^0.0.22",
5151
"@langchain/mistralai": "^0.2.0",

0 commit comments

Comments
 (0)