OrderedAIServiceSelector Class
- java.
lang. Object - com.
microsoft. semantickernel. services. BaseAIServiceSelector - com.
microsoft. semantickernel. services. OrderedAIServiceSelector
- com.
- com.
public class OrderedAIServiceSelector
extends BaseAIServiceSelector
Implementation of AIServiceSelector that selects the AI service based on the order of the execution settings. Uses the service id or model id to select the preferred service provider and then returns the service and associated execution settings.
Constructor Summary
| Constructor | Description |
|---|---|
| OrderedAIServiceSelector() |
Initializes a new instance of the OrderedAIServiceSelector class with an empty collection of services. |
| OrderedAIServiceSelector(AIServiceCollection services) |
Initializes a new instance of the OrderedAIServiceSelector class with the specified services. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| T |
getService(Class<T> clazz)
Gets the service of the specified type. |
|
AIService |
trySelectAIService(Class<T> serviceType, KernelFunction<?> function, KernelFunctionArguments arguments, Map<Class<? extends AIService>,AIService> services)
Resolves an AIService from the |
| AIService |
getService(String serviceId)
Gets the service with the specified service id. |
Methods inherited from BaseAIServiceSelector
Methods inherited from java.lang.Object
Constructor Details
OrderedAIServiceSelector
public OrderedAIServiceSelector()
Initializes a new instance of the OrderedAIServiceSelector class with an empty collection of services.
OrderedAIServiceSelector
public OrderedAIServiceSelector(AIServiceCollection services)
Initializes a new instance of the OrderedAIServiceSelector class with the specified services.
Parameters:
Method Details
getService
public T
Gets the service of the specified type.
Parameters:
Returns:
null if no such service exists.trySelectAIService
public AIServiceSelection
Resolves an AIService from the services argument using the specified function and arguments for selection.
Overrides:
OrderedAIServiceSelector.trySelectAIService(Class<T> serviceType, KernelFunction<?> function, KernelFunctionArguments arguments, Map<Class<? extends AIService>,AIService> services)Parameters:
getService
public AIService getService(String serviceId)
Gets the service with the specified service id.
Parameters:
Returns:
null if no such service exists.