Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jun 21, 2024
1 parent 22292f3 commit 6589a8e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libs/langchain-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ export class ChatOpenAI<
)
);
}
let streamOptionsConfig = {};
if (options?.stream_options !== undefined) {
streamOptionsConfig = { stream_options: options.stream_options };
} else if (this.streamUsage && this.streaming) {
streamOptionsConfig = { stream_options: { include_usage: true } };
}
const params: Omit<
OpenAIClient.Chat.ChatCompletionCreateParams,
"messages"
Expand All @@ -579,11 +585,7 @@ export class ChatOpenAI<
tool_choice: options?.tool_choice,
response_format: options?.response_format,
seed: options?.seed,
...(options?.stream_options !== undefined
? { stream_options: options.stream_options }
: this.streamUsage && this.streaming
? { stream_options: { include_usage: true } }
: {}),
...streamOptionsConfig,
parallel_tool_calls: options?.parallel_tool_calls,
...this.modelKwargs,
};
Expand Down

0 comments on commit 6589a8e

Please sign in to comment.