I’m working with the OpenAI Chat Completions, where I have turned on streaming.
I’m noticing something strange, and it’s probably something I’m missing, but would appreciate a second opinion.
As you can see from the screenshots below, I receive an array of JSON’s from the stream, and I do a little magic to convert it to a regular array of objects which I can manipulate with code.
You can see that the output is correct after using JSON_decode in Xano.
Where something goes a little wrong for me, is when I’m doing a Request to this endpoint from WeWeb and stream = true..
For some reason, I seem to get the Array of objects as JSON again, almost as if JSON_decode is ignored.
Hi @Cedric
It seems that this is a Xano thing, where it always sends streams as a JSON.
To display the text in WeWeb, I created a custom formula, which basically JSON.parse() the data from Xano and displays it as plain text:) Might be better ways of solving it, but this works for me.
Hey @erikm3103, thanks for your reply.
Yip, we came to the same conclusion, however in our case we wanted to stream json items one at a time but then group them by “date” on the F.E.
Because the stream response comes all in one node in the workflow, it’s a challenge to manipulate multiple nested json strings and group them as they come in.
In the end, we opted to use pagination with infinite scroll and still process the grouping on the frontend.
Thanks again bro