ai.wire.send_as
Send, classify non-2xx via `ai.errors.classify_http`, decode the body as T. T = json-shaped envelope class; unknown fields are ignored by the decoder. The request runs under its own `timeout` and `connect_timeout` (see `baml.http.Request`); a client puts its `ai.LlmTimeoutOptions` there.
Reference version
Signature
function ai.wire.send_as<T>(
req: baml.http.Request,
provider: string
) -> T throws baml.errors.Timeout | ai.errors.Failure
Send, classify non-2xx via ai.errors.classify_http, decode the body as T.
T = json-shaped envelope class; unknown fields are ignored by the decoder.
The request runs under its own timeout and connect_timeout (see
baml.http.Request); a client puts its ai.LlmTimeoutOptions there.
Source:<builtin>/ai/ns_wire/wire.bamlbytes 5145–6614