Class ChatMessageImageContentItem

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

public final class ChatMessageImageContentItem extends ChatMessageContentItem
A structured chat content item containing an image reference.
  • Constructor Details

    • ChatMessageImageContentItem

      public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl)
      Creates an instance of ChatMessageImageContentItem class.
      Parameters:
      imageUrl - the imageUrl value to set.
    • ChatMessageImageContentItem

      public ChatMessageImageContentItem(Path filePath, String imageFormat)
      Creates an instance of ChatMessageImageContentItem class.
      Parameters:
      filePath - path to the imageFile.
      imageFormat - format of the image
      Throws:
      RuntimeException - If an error occurs while reading the file or file not found.
  • Method Details

    • getType

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

      public ChatMessageImageUrl getImageUrl()
      Get the imageUrl property: An internet location, which must be accessible to the model,from which the image may be retrieved.
      Returns:
      the imageUrl 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 ChatMessageImageContentItem fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ChatMessageImageContentItem from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ChatMessageImageContentItem 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 ChatMessageImageContentItem.