From 862e386fe79dcc54cd83bef2468fb9bb16e2da44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=BBmijewski?= Date: Tue, 12 Nov 2024 09:56:59 +0100 Subject: [PATCH] Fixed missing tool_choice in call options of chat --- libs/langchain-community/src/chat_models/ibm.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/langchain-community/src/chat_models/ibm.ts b/libs/langchain-community/src/chat_models/ibm.ts index d4dc6a64ba28..399e6d4d2909 100644 --- a/libs/langchain-community/src/chat_models/ibm.ts +++ b/libs/langchain-community/src/chat_models/ibm.ts @@ -41,6 +41,7 @@ import { TextChatResultChoice, TextChatResultMessage, TextChatToolCall, + TextChatToolChoiceTool, TextChatUsage, } from "@ibm-cloud/watsonx-ai/dist/watsonx-ai-ml/vml_v1.js"; import { WatsonXAI } from "@ibm-cloud/watsonx-ai"; @@ -86,6 +87,7 @@ export interface WatsonxCallOptionsChat extends Omit, WatsonxCallParams { promptIndex?: number; + tool_choice?: TextChatToolChoiceTool; } type ChatWatsonxToolType = BindToolsInput | TextChatParameterTools; @@ -470,7 +472,7 @@ export class ChatWatsonx< tools: options.tools ? _convertToolToWatsonxTool(options.tools) : undefined, - toolChoice: options.toolChoice, + toolChoice: options.tool_choice, responseFormat: options.responseFormat, toolChoiceOption: options.toolChoiceOption, };