MultiLlmClientManager class

Manager for multiple LLM clients that implements the ServiceManager interface

Constructors

MultiLlmClientManager({ServiceRouter? router, ServiceBalancer? loadBalancer})
Create a new multi LLM client manager

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceCount int
Get count of services
no setter
serviceIds List<String>
Get a list of all managed service IDs
no setter

Methods

addClient(String clientId, LlmClient client, {Map<String, dynamic>? routingProperties, double weight = 1.0}) → void
Add client with adapter
addService(String serviceId, LlmClientServiceAdapter service, {Map<String, dynamic>? routingProperties, double weight = 1.0}) → void
Add a service to the manager
closeAll() Future<void>
Close all services
fanOutQuery(String query, {bool enableTools = true, Map<String, dynamic> parameters = const {}}) Future<Map<String, LlmResponse>>
Execute same operation on all clients (fan-out)
getClient(String clientId) LlmClient?
Get the underlying LlmClient
getService(String serviceId) → LlmClientServiceAdapter?
Get a service by ID
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeService(String serviceId) Future<void>
Remove a service
selectClient(String query, {Map<String, dynamic>? properties}) LlmClient?
Select the most appropriate client for a query
selectService(String request, {Map<String, dynamic>? properties}) → LlmClientServiceAdapter?
Select the most appropriate service for a request
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited