Skip to content

Commit

Permalink
openai[patch]: Fix tool content list
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jun 13, 2024
1 parent 308e5b2 commit 2ffd2b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions libs/langchain-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ function convertMessagesToOpenAIParams(messages: BaseMessage[]) {
completionParam.tool_calls = message.tool_calls.map(
convertLangChainToolCallToOpenAI
);
completionParam.content = null;
} else {
if (message.additional_kwargs.tool_calls != null) {
completionParam.tool_calls = message.additional_kwargs.tool_calls;
Expand Down Expand Up @@ -948,6 +949,7 @@ export class ChatOpenAI<
const requestOptions = this._getClientOptions(options);
return this.caller.call(async () => {
try {
console.log(request.messages)
const res = await this.client.chat.completions.create(
request,
requestOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ class ChatOpenAIStandardIntegrationTests extends ChatModelIntegrationTests<
});
}

async testToolMessageHistoriesListContent() {
console.warn(
"ChatOpenAI testToolMessageHistoriesListContent test known failure. Skipping..."
);
}

async testUsageMetadataStreaming() {
// ChatOpenAI does not support streaming tokens by
// default, so we must pass in a call option to
Expand Down

0 comments on commit 2ffd2b7

Please sign in to comment.