Enum Role

java.lang.Object
java.lang.Enum<Role>
org.machanism.machai.ai.tools.Role
All Implemented Interfaces:
Serializable, Comparable<Role>

public enum Role extends Enum<Role>
Enumeration representing participant roles in an AI interaction context.

The Role enum defines the possible roles for entities involved in a conversation or tool invocation:

  • ASSISTANT: Represents the AI assistant or provider responding to requests.
  • USER: Represents the end user or client initiating requests or interactions.

This enum is typically used to distinguish between the source and target of messages or actions within the AI framework.

  • Enum Constant Details

    • ASSISTANT

      public static final Role ASSISTANT
      Represents the AI assistant or provider.
    • USER

      public static final Role USER
      Represents the end user or client.
  • Method Details

    • values

      public static Role[] 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 Role 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