Class VectorEmbedding

java.lang.Object
com.azure.resourcemanager.cosmos.models.VectorEmbedding
All Implemented Interfaces:
com.azure.json.JsonSerializable<VectorEmbedding>

public final class VectorEmbedding extends Object implements com.azure.json.JsonSerializable<VectorEmbedding>
Represents a vector embedding. A vector embedding is used to define a vector field in the documents.
  • Constructor Details

    • VectorEmbedding

      public VectorEmbedding()
      Creates an instance of VectorEmbedding class.
  • Method Details

    • path

      public String path()
      Get the path property: The path to the vector field in the document.
      Returns:
      the path value.
    • withPath

      public VectorEmbedding withPath(String path)
      Set the path property: The path to the vector field in the document.
      Parameters:
      path - the path value to set.
      Returns:
      the VectorEmbedding object itself.
    • dataType

      public VectorDataType dataType()
      Get the dataType property: Indicates the data type of vector.
      Returns:
      the dataType value.
    • withDataType

      public VectorEmbedding withDataType(VectorDataType dataType)
      Set the dataType property: Indicates the data type of vector.
      Parameters:
      dataType - the dataType value to set.
      Returns:
      the VectorEmbedding object itself.
    • distanceFunction

      public DistanceFunction distanceFunction()
      Get the distanceFunction property: The distance function to use for distance calculation in between vectors.
      Returns:
      the distanceFunction value.
    • withDistanceFunction

      public VectorEmbedding withDistanceFunction(DistanceFunction distanceFunction)
      Set the distanceFunction property: The distance function to use for distance calculation in between vectors.
      Parameters:
      distanceFunction - the distanceFunction value to set.
      Returns:
      the VectorEmbedding object itself.
    • dimensions

      public int dimensions()
      Get the dimensions property: The number of dimensions in the vector.
      Returns:
      the dimensions value.
    • withDimensions

      public VectorEmbedding withDimensions(int dimensions)
      Set the dimensions property: The number of dimensions in the vector.
      Parameters:
      dimensions - the dimensions value to set.
      Returns:
      the VectorEmbedding object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

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

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