Description
The docs at https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#streaming indicates that, when using the JavaScript library, one is able to specify a JSON schema via the text
parameter and stream the responses.
However, when using the Java library this doesn't appear to be possible as .responses().createStreaming()
only accepts ResponseCreateParams
and using ResponseCreateParams.builder().text(...)
changes the type to StructuredResponseCreateParams<T>
.
Is there a way to stream structured outputs I haven't discovered yet, or is this a known limitation in the current version (2.3.0) of the library?
What I'm trying to achieve without having to manually parse streaming JSON (or JSONL) output is specify that the output is an array of some type T
, then have a stream event where I check something like event.isOutputTextItem()
where I can retrieve each item of type T
individually from the event.