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.
Signature
class ai.clients.RoundRobinRotates 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 11717–15880
Fields
members
counter
intStatic methods
Implementations
ai.Client for ai.clients.RoundRobin
Instance methods
id
(self) -> stringinvoke
(render
(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 12182–14472
ai.stream.StreamingClient for ai.clients.RoundRobin
Instance methods
invoke_stream
(Source:<builtin>/ai/ns_clients/clients.bamlbytes 14478–15878