openai.internal._chat_stream_failure

(internal) `baml.http.fetch_sse` reports a non-2xx as `baml.errors.Io` whose message embeds the status and body: "SSE request failed with status 400: {…}". The status is the only thing standing between a 400 and a retry-safe NetworkFailure that a Retry wrapper would happily replay, so it is recovered here and run through the same classifier the non-streaming path uses.

Reference version

Signature

function openai.internal._chat_stream_failure(provider: string, detail: string) -> ai.errors.Failure

(internal) baml.http.fetch_sse reports a non-2xx as baml.errors.Io whose message embeds the status and body: "SSE request failed with status 400: {…}". The status is the only thing standing between a 400 and a retry-safe NetworkFailure that a Retry wrapper would happily replay, so it is recovered here and run through the same classifier the non-streaming path uses.

Source:<builtin>/openai/ns_internal/chat.bamlbytes 6233163111