feat(server): support openai compatible stream api (#8065)

fix #8010
This commit is contained in:
darkskygit
2024-09-03 09:24:59 +00:00
parent 935771c8a8
commit 41f9149be6

View File

@@ -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;