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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondataType()
Get the dataType property: Indicates the data type of vector.int
Get the dimensions property: The number of dimensions in the vector.Get the distanceFunction property: The distance function to use for distance calculation in between vectors.static VectorEmbedding
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of VectorEmbedding from the JsonReader.path()
Get the path property: The path to the vector field in the document.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withDataType
(VectorDataType dataType) Set the dataType property: Indicates the data type of vector.withDimensions
(int dimensions) Set the dimensions property: The number of dimensions in the vector.withDistanceFunction
(DistanceFunction distanceFunction) Set the distanceFunction property: The distance function to use for distance calculation in between vectors.Set the path property: The path to the vector field in the document.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
VectorEmbedding
public VectorEmbedding()Creates an instance of VectorEmbedding class.
-
-
Method Details
-
path
Get the path property: The path to the vector field in the document.- Returns:
- the path value.
-
withPath
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
Get the dataType property: Indicates the data type of vector.- Returns:
- the dataType value.
-
withDataType
Set the dataType property: Indicates the data type of vector.- Parameters:
dataType
- the dataType value to set.- Returns:
- the VectorEmbedding object itself.
-
distanceFunction
Get the distanceFunction property: The distance function to use for distance calculation in between vectors.- Returns:
- the distanceFunction value.
-
withDistanceFunction
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
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<VectorEmbedding>
- Throws:
IOException
-
fromJson
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.
-