Calculate Vector Distance

res = hc.compute_vector_distance(tbl_name, database_name, "vector_field", "primary_key_name", [1, 2, 3], [[1, 1]], MetricType.L2)  

Result:

This method returns a dictionary representing the distance between vectors.

Parameter description:

ParametersDescriptionRequired
table_name (str)Table nameYes
database_name (str)Database where the table is locatedYes
vector_field (str)Target vector field included in the tableYes
primary_key_name (str)Primary key nameYes
primary_field (list)Primary fieldYes
float_vectors (list[list])Floating-point vector to be comparedYes
metric_type (MetricType)Metric typeYes

Table 112 Calculate Vector Distance (Python API)