Partager via


VectorEmbedding Class

  • java.lang.Object
    • com.azure.resourcemanager.cosmos.models.VectorEmbedding

Implements

public final class VectorEmbedding
implements JsonSerializable<VectorEmbedding>

Represents a vector embedding. A vector embedding is used to define a vector field in the documents.

Constructor Summary

Constructor Description
VectorEmbedding()

Creates an instance of VectorEmbedding class.

Method Summary

Modifier and Type Method and Description
VectorDataType dataType()

Get the dataType property: Indicates the data type of vector.

int dimensions()

Get the dimensions property: The number of dimensions in the vector.

DistanceFunction distanceFunction()

Get the distanceFunction property: The distance function to use for distance calculation in between vectors.

static VectorEmbedding fromJson(JsonReader jsonReader)

Reads an instance of VectorEmbedding from the JsonReader.

String path()

Get the path property: The path to the vector field in the document.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

VectorEmbedding withDataType(VectorDataType dataType)

Set the dataType property: Indicates the data type of vector.

VectorEmbedding withDimensions(int dimensions)

Set the dimensions property: The number of dimensions in the vector.

VectorEmbedding withDistanceFunction(DistanceFunction distanceFunction)

Set the distanceFunction property: The distance function to use for distance calculation in between vectors.

VectorEmbedding withPath(String path)

Set the path property: The path to the vector field in the document.

Methods inherited from java.lang.Object

Constructor Details

VectorEmbedding

public VectorEmbedding()

Creates an instance of VectorEmbedding class.

Method Details

dataType

public VectorDataType dataType()

Get the dataType property: Indicates the data type of vector.

Returns:

the dataType value.

dimensions

public int dimensions()

Get the dimensions property: The number of dimensions in the vector.

Returns:

the dimensions value.

distanceFunction

public DistanceFunction distanceFunction()

Get the distanceFunction property: The distance function to use for distance calculation in between vectors.

Returns:

the distanceFunction value.

fromJson

public static VectorEmbedding fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

path

public String path()

Get the path property: The path to the vector field in the document.

Returns:

the path value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

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.

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.

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.

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.

Applies to