Share via


AIServiceSelector Class

Default service selector, can be subclassed and overridden.

To use a custom service selector, subclass this class and override the select_ai_service method. Make sure that the function signature stays the same.

Constructor

AIServiceSelector()

Methods

select_ai_service

Select an AI Service on a first come, first served basis.

Starts with execution settings in the arguments, followed by the execution settings from the function. If the same service_id is in both, the one in the arguments will be used.

select_ai_service

Select an AI Service on a first come, first served basis.

Starts with execution settings in the arguments, followed by the execution settings from the function. If the same service_id is in both, the one in the arguments will be used.

select_ai_service(kernel: KernelServicesExtension, function: KernelFunction | None = None, arguments: KernelArguments | None = None, type_: type[AI_SERVICE_CLIENT_TYPE] | tuple[type[AI_SERVICE_CLIENT_TYPE], ...] | None = None) -> tuple[AIServiceClientBase, PromptExecutionSettings]

Parameters

Name Description
kernel
Required

The kernel used.

function

The function used. (optional)

Default value: None
arguments

The arguments used. (optional)

Default value: None
type
Required

The type of service to select. (optional)

type_
Default value: None