ai.Client
interface in the ai package.
Signature
interface ai.ClientSource:<builtin>/ai/turn.bamlbytes 3048–4378
Required instance methods
requested_model
(self) -> string throws neverThe model this client asks for, as configured ("claude-sonnet-4-5").
A wrapper reports a member's.
provider
(self) -> string throws neverThe provider this client's calls bill ("anthropic"), as its
ModelKeys name it. A wrapper reports a member's.
Render the provider request shape without performing I/O. Reliability wrappers use this as a stable request-shape preview: they do not sleep, rotate, or try fallback members while rendering.
Default instance methods
default_cache_args
(self) -> baml.json.json throws neverThe args this client uses for a ${cache()} written with none (or
with null): the object its wire's cache marker carries. Null when the
client has no cache marker on its wire, or when the model it is
configured for would reject one; a ${cache()} then sends nothing.
A client that sends cache markers passes this to
ai.wire.prompt_parts(message, default_cache_args).