Class ChatMessageRefusalContentItem

java.lang.Object
com.azure.ai.openai.models.ChatMessageContentItem
com.azure.ai.openai.models.ChatMessageRefusalContentItem
All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatMessageContentItem>

public final class ChatMessageRefusalContentItem extends ChatMessageContentItem
A structured chat content item containing model refusal information for a structured outputs request.
  • Constructor Details

    • ChatMessageRefusalContentItem

      public ChatMessageRefusalContentItem(String refusal)
      Creates an instance of ChatMessageRefusalContentItem class.
      Parameters:
      refusal - the refusal value to set.
  • Method Details

    • getType

      public String getType()
      Get the type property: The discriminated object type.
      Overrides:
      getType in class ChatMessageContentItem
      Returns:
      the type value.
    • getRefusal

      public String getRefusal()
      Get the refusal property: The refusal message.
      Returns:
      the refusal value.
    • toJson

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

      public static ChatMessageRefusalContentItem fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ChatMessageRefusalContentItem from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ChatMessageRefusalContentItem 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 ChatMessageRefusalContentItem.