fix: openai api client (#8154)

This commit is contained in:
SuYao 2025-07-15 10:10:55 +08:00 committed by GitHub
parent fa17c70d85
commit 06baaa1522
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -717,7 +717,12 @@ export class OpenAIAPIClient extends OpenAIBaseClient<
contentSource = choice.message
}
if (!contentSource) continue
if (!contentSource) {
if ('finish_reason' in choice && choice.finish_reason) {
emitCompletionSignals(controller)
}
continue
}
const webSearchData = collectWebSearchData(chunk, contentSource, context)
if (webSearchData) {