ai.clients.RoundRobin

Rotates invocations across members. Replaces the legacy round-robin provider: distribution is a client-boundary concern, exactly like Retry and Fallback. The counter mutates on the shared value, so every call site holding this client participates in one rotation. A streaming call selects and advances the counter exactly once; a failure from that selected stream never rotates again within the same call.

Reference version

Signature

class ai.clients.RoundRobin

Rotates invocations across members. Replaces the legacy round-robin provider: distribution is a client-boundary concern, exactly like Retry and Fallback. The counter mutates on the shared value, so every call site holding this client participates in one rotation. A streaming call selects and advances the counter exactly once; a failure from that selected stream never rotates again within the same call.

Source:<builtin>/ai/ns_clients/clients.bamlbytes 1171715880

Fields

counter

int

Static methods

Implementations

ai.Client for ai.clients.RoundRobin

Instance methods

function

id

(self) -> string
function

render

(
self,
) -> baml.http.Request throws baml.errors.Timeout | baml.errors.UnknownError | reflect.errors.CompilationError | ai.errors.Failure

Rendering is deterministic and side-effect free: preview the first member rather than mutating the invocation rotation counter.

Source:<builtin>/ai/ns_clients/clients.bamlbytes 1218214472