selectService method
LlmClientServiceAdapter?
selectService(})
Select the most appropriate service for a request
Implementation
@override
LlmClientServiceAdapter? selectService(String request, {Map<String, dynamic>? properties}) {
// Route based on request characteristics
String? clientId = _router.routeRequest(request, properties);
// Use load balancer if no routing result
if (clientId == null || !_clients.containsKey(clientId)) {
clientId = _loadBalancer.getNextService();
}
return clientId != null ? _clients[clientId] : null;
}