Class ChatMessage

java.lang.Object
com.azure.ai.openai.models.ChatMessage

public final class ChatMessage extends Object
A single, role-attributed message within a chat completion interaction.
  • Constructor Details

    • ChatMessage

      public ChatMessage(ChatRole role)
      Creates an instance of ChatMessage class.
      Parameters:
      role - the role value to set.
  • Method Details

    • getRole

      public ChatRole getRole()
      Get the role property: The role associated with this message payload.
      Returns:
      the role value.
    • getContent

      public String getContent()
      Get the content property: The text associated with this message payload.
      Returns:
      the content value.
    • setContent

      public ChatMessage setContent(String content)
      Set the content property: The text associated with this message payload.
      Parameters:
      content - the content value to set.
      Returns:
      the ChatMessage object itself.