ToolCallBehavior Class
- java.
lang. Object - com.
microsoft. semantickernel. orchestration. ToolCallBehavior
- com.
public class ToolCallBehavior
Defines the behavior of a tool call. Currently, the only tool available is function calling.
Field Summary
Modifier and Type | Field and Description |
---|---|
static final java.lang.String |
FUNCTION_NAME_SEPARATOR
The separator between the plugin name and the function name. |
Method Summary
Modifier and Type | Method and Description |
---|---|
static
Tool |
allowAllKernelFunctions(boolean autoInvoke)
Allow all kernel functions. |
static
Tool |
allowOnlyKernelFunctions(boolean autoInvoke, KernelFunction<?>[] functions)
Allow a set of kernel functions. |
static
Tool |
allowOnlyKernelFunctions(boolean autoInvoke, List<KernelFunction<?>> functions)
Allow a set of kernel functions. |
static java.lang.String |
formFullFunctionName(String pluginName, String functionName)
Form the full function name. |
int |
getMaximumAutoInvokeAttempts()
Get the maximum number of times that auto-invocation will be attempted. |
boolean |
isAutoInvokeAllowed()
Check whether auto-invocation is enabled. |
static
Tool |
requireKernelFunction(KernelFunction<?> function)
Require a function. |
Methods inherited from java.lang.Object
Field Details
FUNCTION_NAME_SEPARATOR
public static final String FUNCTION_NAME_SEPARATOR
The separator between the plugin name and the function name.
Method Details
allowAllKernelFunctions
public static ToolCallBehavior allowAllKernelFunctions(boolean autoInvoke)
Allow all kernel functions. All Kernel functions will be passed to the model.
Parameters:
Returns:
allowOnlyKernelFunctions
public static ToolCallBehavior allowOnlyKernelFunctions(boolean autoInvoke, KernelFunction[] functions)
Allow a set of kernel functions. If a function is allowed, it may be called. If it is not allowed, it will not be called. By default, all functions are not allowed.
Parameters:
Returns:
allowOnlyKernelFunctions
public static ToolCallBehavior allowOnlyKernelFunctions(boolean autoInvoke, List
Allow a set of kernel functions. If a function is allowed, it may be called. If it is not allowed, it will not be called. By default, all functions are not allowed.
Parameters:
Returns:
formFullFunctionName
public static String formFullFunctionName(String pluginName, String functionName)
Form the full function name.
Parameters:
Returns:
getMaximumAutoInvokeAttempts
public int getMaximumAutoInvokeAttempts()
Get the maximum number of times that auto-invocation will be attempted.
Returns:
isAutoInvokeAllowed
public boolean isAutoInvokeAllowed()
Check whether auto-invocation is enabled.
Returns:
requireKernelFunction
public static ToolCallBehavior requireKernelFunction(KernelFunction function)
Require a function. The required function will be the only function passed to the model and forces the model to call the function. Only one function can be required.
Parameters:
Returns: