You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the backend, I use StreamingTextResponse to merge AIStream and StreamData, where the former transmits a text stream and the latter transmits an audio stream (base64 buffer). The audio stream takes a longer time to transmit.
The issue is that when the AIStream completes, the data in StreamData is repeatedly received by the frontend.
The solution I am currently using is to pass two keys, voice_buffer_base64 and voice_buffer_index, in data.append to filter out duplicate content on the frontend.
Description
I am using SvelteKit 2.0 and vercel/ai 3.1.22.
On the backend, I use StreamingTextResponse to merge AIStream and StreamData, where the former transmits a text stream and the latter transmits an audio stream (base64 buffer). The audio stream takes a longer time to transmit.
The issue is that when the AIStream completes, the data in StreamData is repeatedly received by the frontend.
The solution I am currently using is to pass two keys,
voice_buffer_base64
andvoice_buffer_index
, indata.append
to filter out duplicate content on the frontend.Thank you for your attention to this matter.
Code example
Additional context
No response
The text was updated successfully, but these errors were encountered: