Class EmbeddingInput

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

public final class EmbeddingInput extends Object implements com.azure.json.JsonSerializable<EmbeddingInput>
Represents an image with optional text.
  • Constructor Details

    • EmbeddingInput

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

    • getImage

      public String getImage()
      Get the image property: The input image, in PNG format.
      Returns:
      the image value.
    • getText

      public String getText()
      Get the text property: Optional. The text input to feed into the model (like DINO, CLIP). Returns a 422 error if the model doesn't support the value or parameter.
      Returns:
      the text value.
    • setText

      public EmbeddingInput setText(String text)
      Set the text property: Optional. The text input to feed into the model (like DINO, CLIP). Returns a 422 error if the model doesn't support the value or parameter.
      Parameters:
      text - the text value to set.
      Returns:
      the EmbeddingInput object itself.
    • toJson

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

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