Skip to content

Commit

Permalink
feat(server): support openai compatible stream api (#8065)
Browse files Browse the repository at this point in the history
fix #8010
  • Loading branch information
darkskygit committed Sep 3, 2024
1 parent 935771c commit 41f9149
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ export class OpenAIProvider
);

for await (const message of result) {
if (!Array.isArray(message.choices) || !message.choices.length) {
continue;
}
const content = message.choices[0].delta.content;
if (content) {
yield content;
Expand Down

0 comments on commit 41f9149

Please sign in to comment.