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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.LoggerLogger for shell tool execution and diagnostics. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidmoveToEpisode(int targetId, String name) AI functional tool that moves to the episode specified byidorname.voidrepeateEpisode(String message) AI functional tool that repeats the current episode by terminating the current execution and restarting the same episode, preserving the context.
-
Field Details
-
logger
private static final org.slf4j.Logger loggerLogger for shell tool execution and diagnostics.
-
-
Constructor Details
-
ActSpecFunctionTools
public ActSpecFunctionTools()
-
-
Method Details
-
moveToEpisode
AI functional tool that moves to the episode specified byidorname. Sequential navigation to the next episode is handled automatically by the system and should not invoke this tool.This method always throws a
MoveToEpisodeExceptionto signal episode navigation.- Parameters:
targetId- the ID of the episode to move toname- the name of the episode to move to- Throws:
MoveToEpisodeException- always thrown to signal episode navigation
-
repeateEpisode
AI functional tool that 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
-