Class ResponsesAssistantMessage

All Implemented Interfaces:
com.azure.json.JsonSerializable<ResponsesItem>

public final class ResponsesAssistantMessage extends ResponsesMessage
A message item with the `assistant` role.
  • Constructor Details

    • ResponsesAssistantMessage

      public ResponsesAssistantMessage(List<ResponsesContent> content)
      Creates an instance of ResponsesAssistantMessage class.
      Parameters:
      content - the content value to set.
  • Method Details

    • getType

      public ResponsesItemType getType()
      Get the type property: The type property.
      Overrides:
      getType in class ResponsesMessage
      Returns:
      the type value.
    • getRole

      public ResponsesMessageRole getRole()
      Get the role property: The role associated with the message.
      Overrides:
      getRole in class ResponsesMessage
      Returns:
      the role value.
    • getContent

      public List<ResponsesContent> getContent()
      Get the content property: The content associated with the message.
      Returns:
      the content value.
    • toJson

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

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