Replies: 1 comment
-
Hi, have you figured it out by any chance? It looks like the response is actually in the SSE format, intentionally prepended with the 'data: '. I assume I can strip it from the string but I don't understand why I have to do that instead of actually getting a valid object directly from the model. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to stream responses with the Cloudflare AI, using their starter example here: https://developers.cloudflare.com/workers-ai/tutorials/build-a-retrieval-augmented-generation-ai/
My basic code is below. The problem is that I can stream the message, but the browser shows the entire response like this:
data: {"response":" ","p":"abcdefghijklmnopqrstuvwxyz01234567"} data: {"response":" Based","p":"abcdefghijklmnopqrstuvwxyz0123456789abcde"}
Obviously, the user just needs to see the response. But, how do you stream that? Here is my code:
Beta Was this translation helpful? Give feedback.
All reactions