ToolCallBehavior.AllowedKernelFunctions Class

public static class ToolCallBehavior.AllowedKernelFunctions
extends ToolCallBehavior

A set of allowed kernel functions. All kernel functions are allowed if allKernelFunctionsAllowed is true. Otherwise, only the functions in allowedFunctions are allowed.

If a function is allowed, it may be called. If it is not allowed, it will not be called.

Constructor Summary

Constructor Description
AllowedKernelFunctions(boolean allKernelFunctionsAllowed, boolean autoInvoke, List<KernelFunction<?>> allowedFunctions)

Create a new instance of AllowedKernelFunctions.

Method Summary

Modifier and Type Method and Description
boolean isAllKernelFunctionsAllowed()

Check whether all kernel functions are allowed.

boolean isFunctionAllowed(KernelFunction<?> function)

Check whether the given function is allowed.

boolean isFunctionAllowed(String pluginName, String functionName)

Check whether the given function is allowed.

Methods inherited from ToolCallBehavior

allowAllKernelFunctions com.microsoft.semantickernel.orchestration.ToolCallBehavior.allowOnlyKernelFunctions(boolean,com.microsoft.semantickernel.semanticfunctions.KernelFunction< com.microsoft.semantickernel.orchestration.ToolCallBehavior.allowOnlyKernelFunctions(boolean,java.util.List<com.microsoft.semantickernel.semanticfunctions.KernelFunction< formFullFunctionName getMaximumAutoInvokeAttempts isAutoInvokeAllowed com.microsoft.semantickernel.orchestration.ToolCallBehavior.requireKernelFunction(com.microsoft.semantickernel.semanticfunctions.KernelFunction<

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

AllowedKernelFunctions

public AllowedKernelFunctions(boolean allKernelFunctionsAllowed, boolean autoInvoke, List> allowedFunctions)

Create a new instance of AllowedKernelFunctions.

Parameters:

allKernelFunctionsAllowed - Whether all kernel functions are allowed.
autoInvoke - Whether auto-invocation is enabled.
allowedFunctions - A set of functions that are allowed.

Method Details

isAllKernelFunctionsAllowed

public boolean isAllKernelFunctionsAllowed()

Check whether all kernel functions are allowed.

Returns:

Whether all kernel functions are allowed.

isFunctionAllowed

public boolean isFunctionAllowed(KernelFunction function)

Check whether the given function is allowed.

Parameters:

function - The function to check.

Returns:

Whether the function is allowed.

isFunctionAllowed

public boolean isFunctionAllowed(String pluginName, String functionName)

Check whether the given function is allowed.

Parameters:

pluginName - The name of the skill that the function is in.
functionName - The name of the function.

Returns:

Whether the function is allowed.

Applies to