Version: latest
agrag.agents.middleware.RoundRobinModelMiddleware
RoundRobinModelMiddleware(models:list[Any]) -> None
Bases: AgentMiddleware
Rotate model requests across configured clients.
Functions:
- awrap_model_call – Invoke the next model in the rotation asynchronously.
- wrap_model_call – Invoke the next model in the rotation.
awrap_model_call
awrap_model_call(request:ModelRequest, handler:Callable[[ModelRequest], Awaitable[ModelResponse]]) -> Any
Invoke the next model in the rotation asynchronously.
wrap_model_call
wrap_model_call(request:ModelRequest, handler:Callable[[ModelRequest], ModelResponse]) -> Any
Invoke the next model in the rotation.