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
No known key found for this signature in database
GPG Key ID: 97B7D036B1566E9D

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;