Streaming using Structured Outputs

yeah i understand (i guess), what I would expect is


{"description": "H"}

{"description": "He"}

{"description": "Hello"}

{"description": "Hello World!"}

But instead I get:

{"
{"des
{"description

Which is kind of not helpful respectively requires some workaround.

You requested streaming, which is optional, but if you are waiting for a complete JSON, doesn’t serve you much purpose except as an alternative for run status polling.

But I need a JSON response, because I need structured data and I also need a stream. That’s my “problem”.

1 Like

You should complete the JSON structure yourself. Use a library or write your own function for this.

Library for JS