Skip to content

Commit

Permalink
fix: google stream data stop
Browse files Browse the repository at this point in the history
  • Loading branch information
李兴广 committed Dec 29, 2023
1 parent 1aa84af commit e1fa797
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/google/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const parseStream = (rawResponse: Response) => {
const queue = encoder.encode(text)
controller.enqueue(queue)
if (json.candidates[0].finishReason === 'STOP')
controller.close()
setTimeout(() => controller.close(), 300)
} catch (e) {
controller.error(e)
}
Expand Down

0 comments on commit e1fa797

Please sign in to comment.