Class ChatRole

java.lang.Object
com.azure.core.util.ExpandableStringEnum<ChatRole>
com.azure.ai.inference.models.ChatRole
All Implemented Interfaces:
com.azure.core.util.ExpandableEnum<String>

public final class ChatRole extends com.azure.core.util.ExpandableStringEnum<ChatRole>
A description of the intended purpose of a message within a chat completions interaction.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ChatRole
    The role that provides responses to system-instructed, user-prompted input.
    static final ChatRole
    The role that instructs or sets the behavior of the assistant.
    static final ChatRole
    The role that instructs or sets the behavior of the assistant.
    static final ChatRole
    The role that represents extension tool activity within a chat completions operation.
    static final ChatRole
    The role that provides input for chat completions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Use the fromString(String) factory method.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ChatRole
    Creates or finds a ChatRole from its string representation.
    Gets known ChatRole values.

    Methods inherited from class com.azure.core.util.ExpandableStringEnum

    equals, fromString, getValue, hashCode, toString, values

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • SYSTEM

      public static final ChatRole SYSTEM
      The role that instructs or sets the behavior of the assistant.
    • USER

      public static final ChatRole USER
      The role that provides input for chat completions.
    • ASSISTANT

      public static final ChatRole ASSISTANT
      The role that provides responses to system-instructed, user-prompted input.
    • TOOL

      public static final ChatRole TOOL
      The role that represents extension tool activity within a chat completions operation.
    • DEVELOPER

      public static final ChatRole DEVELOPER
      The role that instructs or sets the behavior of the assistant. Some AI models support this role instead of the 'system' role.
  • Constructor Details

  • Method Details

    • fromString

      public static ChatRole fromString(String name)
      Creates or finds a ChatRole from its string representation.
      Parameters:
      name - a name to look for.
      Returns:
      the corresponding ChatRole.
    • values

      public static Collection<ChatRole> values()
      Gets known ChatRole values.
      Returns:
      known ChatRole values.