Class ChatRequestMessage

java.lang.Object
com.azure.ai.inference.models.ChatRequestMessage
All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatRequestMessage>
Direct Known Subclasses:
ChatRequestAssistantMessage, ChatRequestDeveloperMessage, 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 Summary

    Constructors
    Constructor
    Description
    Creates an instance of ChatRequestMessage class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of ChatRequestMessage from the JsonReader.
    Get the role property: The chat role associated with this message.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • 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.