openai.internal.with_structured_output

(internal) `turn` with its answer read through `structured`. A turn that calls tools, was cut short, or refused holds no answer to read, and goes to the runner as it is; any other turn's last text must decode, or this throws. So `parsed_output` is never left for the runner to fill with SAP.

Reference version

Signature

function openai.internal.with_structured_output(
turn: ai.ModelTurn,
provider: string
) -> ai.ModelTurn throws ai.errors.ParseFailed

(internal) turn with its answer read through structured. A turn that calls tools, was cut short, or refused holds no answer to read, and goes to the runner as it is; any other turn's last text must decode, or this throws. So parsed_output is never left for the runner to fill with SAP.

Source:<builtin>/openai/ns_internal/structured.bamlbytes 9988–10458