Skip to content

Commit

Permalink
fix[community]: Fixed missing tool_choice in call options of chat IBM (
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipZmijewski authored Nov 12, 2024
1 parent 60329e2 commit 1a1b7a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/langchain-community/src/chat_models/ibm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -86,6 +87,7 @@ export interface WatsonxCallOptionsChat
extends Omit<BaseLanguageModelCallOptions, "stop">,
WatsonxCallParams {
promptIndex?: number;
tool_choice?: TextChatToolChoiceTool;
}

type ChatWatsonxToolType = BindToolsInput | TextChatParameterTools;
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 1a1b7a6

Please sign in to comment.