Skip to content

Commit

Permalink
streaming type support
Browse files Browse the repository at this point in the history
  • Loading branch information
cfortuner committed Sep 7, 2024
1 parent f82f647 commit 0c40688
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/openai-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ export class OpenAIClient<T extends ConfigOpts = ConfigOpts> {
}

/** Create a chat completion and stream back partial progress. */
async streamChatCompletion(
params: ChatStreamParams<InferProvider<T>>,
opts?: RequestOpts
async streamChatCompletion<R extends RequestOpts>(
params: ChatStreamParams<InferProvider<R['headers'] & T>>,
opts?: R
): Promise<ChatStreamResponse> {
if (this.getProvider(opts?.headers?.baseUrl) === 'anthropic') {
const anthropicParams = this.convertChatParamsToAnthropicFormat(params as ChatParams<'anthropic'>);
Expand Down

0 comments on commit 0c40688

Please sign in to comment.