Carried over from #126 and originally requested by @agrobbin.
Structured-output parsing works when creating a Response synchronously and when resuming a response stream with the model supplied again. It is still not available for the ordinary non-streaming background retrieval path: client.responses.retrieve(response_id) does not accept a structured-output model, so retrieved output cannot be coerced back into that model through content.parsed.
Desired behavior
Allow callers to supply the original structured-output model when retrieving a stored/background Response, for example:
response = client.responses.retrieve(
response_id,
text: CalendarEvent
)
The exact API can differ, but it should:
- parse matching output content into the supplied model;
- support tool models consistently where applicable;
- leave retrieval without a model backward-compatible;
- document the background create/poll/retrieve flow; and
- include tests for completed and not-yet-completed background responses.
Related partial support: structured-output parsing is already available when resuming streams. Source: #126.
Carried over from #126 and originally requested by @agrobbin.
Structured-output parsing works when creating a Response synchronously and when resuming a response stream with the model supplied again. It is still not available for the ordinary non-streaming background retrieval path:
client.responses.retrieve(response_id)does not accept a structured-output model, so retrieved output cannot be coerced back into that model throughcontent.parsed.Desired behavior
Allow callers to supply the original structured-output model when retrieving a stored/background Response, for example:
The exact API can differ, but it should:
Related partial support: structured-output parsing is already available when resuming streams. Source: #126.