Class ChatRequestMessage

java.lang.Object
com.azure.ai.openai.models.ChatRequestMessage
All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatRequestMessage>
Direct Known Subclasses:
ChatRequestAssistantMessage, ChatRequestFunctionMessage, ChatRequestSystemMessage, ChatRequestToolMessage, ChatRequestUserMessage

public class ChatRequestMessage extends Object implements com.azure.json.JsonSerializable<ChatRequestMessage>
An abstract representation of a chat message as provided in a request.
  • Constructor Details

    • ChatRequestMessage

      public ChatRequestMessage()
      Creates an instance of ChatRequestMessage class.
  • Method Details

    • getRole

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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<ChatRequestMessage>
      Throws:
      IOException
    • fromJson

      public static ChatRequestMessage fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ChatRequestMessage from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ChatRequestMessage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the ChatRequestMessage.