Skip to content

Commit b1cef30

Browse files
authored
openai[patch]: Fix tool content list (#5756)
* openai[patch]: Fix tool content list * same for func calls * chore: lint files * drop console log
1 parent 308e5b2 commit b1cef30

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

libs/langchain-openai/src/chat_models.ts

+2
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,13 @@ function convertMessagesToOpenAIParams(messages: BaseMessage[]) {
228228
}
229229
if (message.additional_kwargs.function_call != null) {
230230
completionParam.function_call = message.additional_kwargs.function_call;
231+
completionParam.content = null;
231232
}
232233
if (isAIMessage(message) && !!message.tool_calls?.length) {
233234
completionParam.tool_calls = message.tool_calls.map(
234235
convertLangChainToolCallToOpenAI
235236
);
237+
completionParam.content = null;
236238
} else {
237239
if (message.additional_kwargs.tool_calls != null) {
238240
completionParam.tool_calls = message.additional_kwargs.tool_calls;

libs/langchain-openai/src/tests/chat_models.standard.int.test.ts

-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ class ChatOpenAIStandardIntegrationTests extends ChatModelIntegrationTests<
2424
});
2525
}
2626

27-
async testToolMessageHistoriesListContent() {
28-
console.warn(
29-
"ChatOpenAI testToolMessageHistoriesListContent test known failure. Skipping..."
30-
);
31-
}
32-
3327
async testUsageMetadataStreaming() {
3428
// ChatOpenAI does not support streaming tokens by
3529
// default, so we must pass in a call option to

0 commit comments

Comments
 (0)