Enum ContextBehavior

java.lang.Object
java.lang.Enum<ContextBehavior>
uno.anahata.ai.tools.ContextBehavior
All Implemented Interfaces:
Serializable, Comparable<ContextBehavior>, java.lang.constant.Constable

public enum ContextBehavior extends Enum<ContextBehavior>
Defines how the output of an AIToolMethod should be treated within the conversation context.

This allows for declarative, intelligent context management, ensuring that the model always has the most relevant and up-to-date information without unnecessary bloat.

Author:
Anahata
  • Enum Constant Details

    • EPHEMERAL

      public static final ContextBehavior EPHEMERAL
      The result is ephemeral and does not represent a lasting state.

      It is useful for one-off actions or queries (e.g., running a shell command). The system automatically prunes these results after 5 user turns to keep the context clean.

    • STATEFUL_REPLACE

      public static final ContextBehavior STATEFUL_REPLACE
      The result represents a stateful resource (like a file's content) that should replace any previous version of the same resource in the context.

      The system uses this to maintain an "Active Workspace" view, ensuring only the latest version of a resource is considered and automatically pruning older versions.

  • Method Details

    • values

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

      public static ContextBehavior valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null