Class Tool
java.lang.Object
me.zacharias.chat.plugin.tool.Tool
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PluginThe parent plugin of this tool, used bygetToolJSON(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ToolResponsecallTool(ToolArguments arguments) This is the main course of the tool.Description for the LLM on what this tool doesfinal StringThe core uses this method when generating the list of available functions to the LLMabstract @NotNull Stringname()Name of the tool.abstract @NotNull ToolParametersThe parameters this tool allows
-
Field Details
-
PLUGIN
The parent plugin of this tool, used bygetToolJSON().
-
-
Constructor Details
-
Tool
-
-
Method Details
-
getToolJSON
The core uses this method when generating the list of available functions to the LLM- Returns:
- a string formated JSON containing the representation of the tool definitions
-
name
Name of the tool.
- Returns:
- returns the name of this tool
-
description
Description for the LLM on what this tool does- Returns:
- Short description defining the scope of this tool
-
parameters
The parameters this tool allows- Returns:
- A
ToolParametersobject defining what this tool expects when being called
-
callTool
This is the main course of the tool. The LLM will call this on request of using your tool- Parameters:
arguments- A collective of yourToolParametersfromparameters()- Returns:
- The expected results, or
ToolResponse.empty(Tool)if this is a "void" function - Throws:
ToolRuntimeException- This indicates that anExceptionis not fatal, any other exceptions thrown from this tool will be treated as fatal, and will result in this tool, or it's plugin being disabled
-