Package org.machanism.machai.ai.tools
This package defines the contracts and loader used to publish local application capabilities
to a Genai instance. Implementations of
FunctionTools register one or more named tools, while
ToolFunction represents the executable callback invoked
when a provider requests a tool execution. FunctionToolsLoader
discovers available tool providers through Java's ServiceLoader mechanism and
applies them to a target provider.
Tool implementations in this package are intended to bridge provider-initiated tool calls to
controlled host-side functionality such as file access, HTTP retrieval, command execution, or
other application-specific operations. When available, a
Configurator can be supplied to tool
providers so they can resolve runtime configuration before registering tools.
Typical usage
Configurator configurator = ...;
Genai provider = ...;
FunctionToolsLoader loader = new FunctionToolsLoader();
loader.applyTools(provider, configurator);
Configuration values may contain placeholders such as ${...}; when supported by a tool provider, these placeholders are resolved through the supplied configurator while unresolved values remain unchanged.
-
ClassDescriptionService-provider interface (SPI) for installing host-provided function tools into a
Genai.Discovers and appliesFunctionToolsimplementations using Java'sServiceLoadermechanism.Functional interface representing a tool callable by a provider during a run.