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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(AiToolContext context, AiToolInput input) Run the tool - returning the data to send to the model.The tool's definition.abstract StringThe tool's description, for the model.The names of the tool's input properties (all others are rejected).The tool's strict input schema (an object schema).abstract AiToolKindgetKind()The tool's kind.abstract StringgetName()The tool's wire name (snake_case).
-
Constructor Details
-
AbstractAiTool
public AbstractAiTool()
-
-
Method Details
-
getName
The tool's wire name (snake_case). -
getDescription
The tool's description, for the model. -
getKind
The tool's kind. -
getInputSchema
-
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
The tool's definition. -
getInputPropertyNames
The names of the tool's input properties (all others are rejected).
-