forked from microsoft/semantic-kernel-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoFunctionChoiceBehavior.java
More file actions
39 lines (34 loc) · 1.33 KB
/
AutoFunctionChoiceBehavior.java
File metadata and controls
39 lines (34 loc) · 1.33 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
package com.microsoft.semantickernel.functionchoice;
import com.microsoft.semantickernel.semanticfunctions.KernelFunction;
import javax.annotation.Nullable;
import java.util.List;
/**
* A set of allowed kernel functions. All kernel functions are allowed if allKernelFunctionsAllowed is true.
* Otherwise, only the functions in allowedFunctions are allowed.
* <p>
* If a function is allowed, it may be called. If it is not allowed, it will not be called.
*/
public class AutoFunctionChoiceBehavior extends FunctionChoiceBehavior {
private final boolean autoInvoke;
/**
* Create a new instance of AutoFunctionChoiceBehavior.
*
* @param autoInvoke Whether auto-invocation is enabled.
* @param functions A set of functions to advertise to the model.
* @param options Options for the function choice behavior.
*/
public AutoFunctionChoiceBehavior(boolean autoInvoke,
@Nullable List<KernelFunction<?>> functions,
@Nullable FunctionChoiceBehaviorOptions options) {
super(functions, options);
this.autoInvoke = autoInvoke;
}
/**
* Check whether the given function is allowed.
*
* @return Whether the function is allowed.
*/
public boolean isAutoInvoke() {
return autoInvoke;
}
}