forked from microsoft/semantic-kernel-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAIServiceSelector.java
More file actions
58 lines (54 loc) · 2.64 KB
/
AIServiceSelector.java
File metadata and controls
58 lines (54 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel.services;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import com.microsoft.semantickernel.semanticfunctions.KernelArguments;
import javax.annotation.Nullable;
/**
* Represents a selector which will return an {@link AIServiceSelection} containing instances of
* {@link AIService} and {@link com.microsoft.semantickernel.orchestration.PromptExecutionSettings}
* from the specified provider based on the model settings.
*/
public interface AIServiceSelector {
/**
* Resolves an {@link AIService} and associated and
* {@link com.microsoft.semantickernel.orchestration.PromptExecutionSettings} based on the
* associated {@link KernelFunction} and {@link KernelArguments}.
*
* @param serviceType The type of service to select. This must be the same type with which the
* service was registered in the {@link AIServiceSelection}
* @param function The KernelFunction to use to select the service, or {@code null}.
* @param arguments The KernelArguments to use to select the service, or
* {@code null}.
* @param <T> The type of service to select.
* @return An {@code AIServiceSelection} containing the selected service and associated
* PromptExecutionSettings.
*
* @deprecated Use {@link #trySelectAIService(Class, KernelArguments)} instead.
*/
@Deprecated
@Nullable
<T extends AIService> AIServiceSelection<T> trySelectAIService(
Class<T> serviceType,
@Nullable KernelFunction<?> function,
@Nullable KernelArguments arguments);
/**
* Resolves an {@link AIService} and associated and
* {@link com.microsoft.semantickernel.orchestration.PromptExecutionSettings} based on the
* associated {@link KernelFunction} and {@link KernelArguments}.
*
* @param serviceType The type of service to select. This must be the same type with which the
* service was registered in the {@link AIServiceSelection}
* @param arguments The KernelArguments to use to select the service, or
* {@code null}.
* @param <T> The type of service to select.
* @return An {@code AIServiceSelection} containing the selected service and associated
* PromptExecutionSettings.
*/
@Nullable
default <T extends AIService> AIServiceSelection<T> trySelectAIService(
Class<T> serviceType,
@Nullable KernelArguments arguments) {
throw new UnsupportedOperationException(
"This method is not implemented.");
}
}