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, };