Class OrderedAIServiceSelector
- java.lang.Object
-
- com.microsoft.semantickernel.services.BaseAIServiceSelector
-
- com.microsoft.semantickernel.services.OrderedAIServiceSelector
-
- All Implemented Interfaces:
AIServiceSelector
public class OrderedAIServiceSelector extends BaseAIServiceSelector
Implementation ofAIServiceSelectorthat 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
Constructors Constructor Description OrderedAIServiceSelector()Initializes a new instance of theOrderedAIServiceSelectorclass with an empty collection of services.OrderedAIServiceSelector(AIServiceCollection services)Initializes a new instance of theOrderedAIServiceSelectorclass with the specified services.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends AIService>
TgetService(Class<T> clazz)Gets the service of the specified type.AIServicegetService(String serviceId)Gets the service with the specified service id.<T extends AIService>
AIServiceSelection<T>trySelectAIService(Class<T> serviceType, KernelFunction<?> function, KernelFunctionArguments arguments, Map<Class<? extends AIService>,AIService> services)-
Methods inherited from class com.microsoft.semantickernel.services.BaseAIServiceSelector
trySelectAIService
-
-
-
-
Constructor Detail
-
OrderedAIServiceSelector
public OrderedAIServiceSelector()
Initializes a new instance of theOrderedAIServiceSelectorclass with an empty collection of services.
-
OrderedAIServiceSelector
public OrderedAIServiceSelector(AIServiceCollection services)
Initializes a new instance of theOrderedAIServiceSelectorclass with the specified services.- Parameters:
services- The services to select from.
-
-
Method Detail
-
trySelectAIService
@Nullable public <T extends AIService> AIServiceSelection<T> trySelectAIService(Class<T> serviceType, @Nullable KernelFunction<?> function, @Nullable KernelFunctionArguments arguments, Map<Class<? extends AIService>,AIService> services)
-
getService
@Nullable public AIService getService(String serviceId)
Gets the service with the specified service id.- Parameters:
serviceId- The service id.- Returns:
- The service with the specified service id, or
nullif no such service exists. - See Also:
AIService.getServiceId()
-
-