ai.Client
interface in the ai package.
Reference version
Signature
interface ai.ClientSource:<builtin>/ai/turn.bamlbytes 2257–3276
Required instance methods
function
id
(self) -> string throws neverRender 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
function
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).