Package org.machanism.machai.ai.tools
Interface FunctionTools
- All Known Implementing Classes:
CommandFunctionTools,WebFunctionTools
public interface FunctionTools
Service-provider interface (SPI) for installing host-provided function tools into a
Genai.
Implementations contribute one or more named tools via
Genai.addTool(String, String, org.machanism.machai.ai.provider.Genai.ToolFunction, String...). Tools are
typically discovered via ServiceLoader and applied at runtime by FunctionToolsLoader.
Implementations may optionally accept a Configurator via setConfigurator(Configurator) to
resolve runtime configuration (for example, API tokens for web calls).
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTools(Genai provider) Registers this tool set with the given provider.default Stringreplace(String value, Configurator conf) Resolves ${...} placeholders using the provided configurator.default voidsetConfigurator(Configurator configurator) Provides a configurator instance to the tool set.
-
Method Details
-
applyTools
Registers this tool set with the given provider.- Parameters:
provider- provider to register tools with
-
setConfigurator
Provides a configurator instance to the tool set.The default implementation does nothing.
- Parameters:
configurator- configurator to use for runtime value resolution
-
replace
Resolves ${...} placeholders using the provided configurator.Unresolvable placeholders are left as-is.
- Parameters:
value- raw value that may contain placeholdersconf- configurator used for lookup; ifnull, the value is returned unchanged- Returns:
- resolved value
-