Class ActSpecFunctionTools

java.lang.Object
org.machanism.machai.gw.tools.ActSpecFunctionTools
All Implemented Interfaces:
FunctionTools

public class ActSpecFunctionTools extends Object implements 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 Details

    • ActSpecFunctionTools

      public ActSpecFunctionTools()
  • Method Details

    • moveToEpisode

      public void moveToEpisode(int targetId, String name)
      Moves to the next episode, or to the episode specified by 'id' or 'name' if provided.

      This method always throws a MoveToEpisodeException to signal episode navigation.

    • repeateEpisode

      public void repeateEpisode(String message)
      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