Class AbstractAiTool

java.lang.Object
com.kingsrook.qqq.backend.core.actions.ai.tools.AbstractAiTool
Direct Known Subclasses:
CountRecordsTool, DescribeTableTool, GetRecordHistoryTool, GetRecordTool, ListTablesTool, NavigateTool, QueryRecordsTool, RenderWidgetTool, SearchHelpTool, SearchRecordsTool

public abstract class AbstractAiTool extends Object
Base class for the AI tools the kernel runs. A tool declares its wire name, description, kind and strict input schema; and executes in the requesting user's QContext, returning the data for the model (which the kernel serializes and wraps in the data envelope), while filling the per-call result (summary, record refs, render payload...) through the context. A tool signals DENIED / NOT_FOUND / INVALID_INPUT by throwing an AiToolException.
  • Constructor Details

    • AbstractAiTool

      public AbstractAiTool()
  • Method Details

    • getName

      public abstract String getName()
      The tool's wire name (snake_case).
    • getDescription

      public abstract String getDescription()
      The tool's description, for the model.
    • getKind

      public abstract AiToolKind getKind()
      The tool's kind.
    • getInputSchema

      public abstract Map<String,Object> getInputSchema()
      The tool's strict input schema (an object schema).
    • execute

      public abstract Map<String,Object> execute(AiToolContext context, AiToolInput input) throws QException
      Run the tool - returning the data to send to the model.
      Throws:
      QException
    • getDefinition

      public AiToolDefinition getDefinition()
      The tool's definition.
    • getInputPropertyNames

      public Collection<String> getInputPropertyNames()
      The names of the tool's input properties (all others are rejected).