Package org.machanism.machai.gw.tools
Class ActSpecFunctionTools
java.lang.Object
org.machanism.machai.gw.tools.ActSpecFunctionTools
- All Implemented Interfaces:
FunctionTools
Provides functional tools for episode navigation and control within the
ActProcessor context.
This class registers tools for moving between episodes and repeating episodes
in a project workflow. It is intended for use with ActProcessor and
integrates with the Genai provider.
- Author:
- Viktor Tovstyi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidmoveToEpisode(int targetId, String name) Moves to the next episode, or to the episode specified by 'id' or 'name' if provided.voidrepeateEpisode(String message) Repeats the current episode by terminating the current execution and restarting the same episode, preserving the context.
-
Constructor Details
-
ActSpecFunctionTools
public ActSpecFunctionTools()
-
-
Method Details
-
moveToEpisode
Moves to the next episode, or to the episode specified by 'id' or 'name' if provided.This method always throws a
MoveToEpisodeExceptionto signal episode navigation. -
repeateEpisode
Repeats the current episode by terminating the current execution and restarting the same episode, preserving the context.This method can be used to re-execute the current episode, for example, after a validation failure or when additional user input is required. If a custom message is provided, it is logged before the episode is repeated.
- Parameters:
message- A custom response message to output before repeating the episode. If empty, no message is logged.- Throws:
RepeatEpisodeException- always thrown to signal the episode should be repeated
-