Enum Class SnapshotTrigger

java.lang.Object
java.lang.Enum<SnapshotTrigger>
com.tnsai.context.snapshot.SnapshotTrigger
All Implemented Interfaces:
Serializable, Comparable<SnapshotTrigger>, Constable

public enum SnapshotTrigger extends Enum<SnapshotTrigger>
Defines when context snapshots are captured.

Snapshot triggers determine the circumstances under which the agent's state is recorded. This enables correlation between snapshots and specific events in the agent lifecycle.

Usage Example


 ContextSnapshot snapshot = contextManager.createSnapshot(SnapshotTrigger.PRE_DECISION);
 // ... make decision ...
 ContextSnapshot afterSnapshot = contextManager.createSnapshot(SnapshotTrigger.POST_DECISION);
 SnapshotDiff diff = snapshot.diff(afterSnapshot);
 
  • Enum Constant Details

    • PRE_DECISION

      public static final SnapshotTrigger PRE_DECISION
      Snapshot taken before a decision is made. Captures the agent's state when deliberation begins.
    • POST_DECISION

      public static final SnapshotTrigger POST_DECISION
      Snapshot taken after a decision is made. Captures the result of deliberation.
    • PERIODIC

      public static final SnapshotTrigger PERIODIC
      Snapshot taken at regular intervals. Used for background state monitoring.
    • MANUAL

      public static final SnapshotTrigger MANUAL
      Snapshot taken on explicit request. Used for debugging or inspection.
    • ERROR_RECOVERY

      public static final SnapshotTrigger ERROR_RECOVERY
      Snapshot taken during error recovery. Captures state for post-mortem analysis.
    • CHECKPOINT

      public static final SnapshotTrigger CHECKPOINT
      Snapshot taken when agent state is checkpointed. Used for persistence and recovery.
    • CONVERSATION_START

      public static final SnapshotTrigger CONVERSATION_START
      Snapshot taken when a new conversation starts.
    • CONVERSATION_END

      public static final SnapshotTrigger CONVERSATION_END
      Snapshot taken when a conversation ends.
    • PRE_TOOL_CALL

      public static final SnapshotTrigger PRE_TOOL_CALL
      Snapshot taken before tool execution.
    • POST_TOOL_CALL

      public static final SnapshotTrigger POST_TOOL_CALL
      Snapshot taken after tool execution.
    • BELIEF_REVISION

      public static final SnapshotTrigger BELIEF_REVISION
      Snapshot taken when beliefs are revised.
    • GOAL_CHANGE

      public static final SnapshotTrigger GOAL_CHANGE
      Snapshot taken when agent goals change.
  • Method Details

    • values

      public static SnapshotTrigger[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SnapshotTrigger valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null