Class FunctionTool

java.lang.Object
me.neurodock.llm.tools.FunctionTool
All Implemented Interfaces:
Tool
Direct Known Subclasses:
AddArrayMemory, AddMemoryFunction, GetArrayedMemories, GetArrayMemory, GetMemoriesFunction, GetMemoryFunction, GetMemoryIdentitiesFunction, ReadFileTool, RemoveMemoryFunction, WriteFileTool

public abstract class FunctionTool extends Object implements Tool
  • Constructor Details

    • FunctionTool

      public FunctionTool()
  • Method Details

    • name

      @NotNull public abstract @NotNull String name()
      The name of the tool. Used by the model to identify what it's calling.
      Specified by:
      name in interface Tool
      Returns:
      the tool's name
    • description

      public String description()
      The description of the tool. Used by the model to understand what the tool does. May be null to omit it from the serialized JSON.
      Returns:
      the tool's description, or null
    • parameters

      @NotNull public abstract @NotNull ToolParameters parameters()
      The parameters this tool accepts.
      Returns:
      the tool's parameter schema
    • function

      @NotNull public abstract @NotNull ToolResponse function(ToolArguments args) throws ToolException
      Invokes the tool.
      Parameters:
      args - the arguments passed by the model
      Returns:
      the tool's response
      Throws:
      ToolException - if the tool encounters an error