Class ToolCallBehavior.AllowedKernelFunctions

  • Enclosing class:
    ToolCallBehavior

    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 Detail

      • AllowedKernelFunctions

        public AllowedKernelFunctions​(boolean allKernelFunctionsAllowed,
                                      boolean autoInvoke,
                                      @Nullable
                                      List<KernelFunction<?>> 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 Detail

      • 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​(@Nullable
                                         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.
      • isAllKernelFunctionsAllowed

        public boolean isAllKernelFunctionsAllowed()
        Check whether all kernel functions are allowed.
        Returns:
        Whether all kernel functions are allowed.