Package org.machanism.machai.gw.tools
Class CommandSpecFunctionTools
java.lang.Object
org.machanism.machai.gw.tools.CommandSpecFunctionTools
- All Implemented Interfaces:
FunctionTools
Provides function tools for task and execution control within the
AIFileProcessor context.
This class registers tools for terminating execution and ending tasks in a
controlled manner. It is intended for use with AIFileProcessor and
integrates with the Genai provider.
- Author:
- Viktor Tovstyi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompletes the current task by throwing anEndTaskException.terminateExecution(String message, int exitCode, File projectDir) Terminates the application by throwing aProcessTerminationException.
-
Constructor Details
-
CommandSpecFunctionTools
public CommandSpecFunctionTools()
-
-
Method Details
-
terminateExecution
Terminates the application by throwing aProcessTerminationException.Reads
messageandexitCodefrom the suppliedJsonNodeand throws aProcessTerminationException. This mechanism allows a tool invocation to abort the overall workflow with an explicit exit code. -
endTask
Completes the current task by throwing anEndTaskException.This method is intended to be used as a function tool for terminating a process when requested by the user or dictated by process logic. It logs the task completion and uses a custom message if provided in the properties.
-