Skip to content

Commit 514cb48

Browse files
Update python doc for MultiVector data type (#1713)
### What problem does this PR solve? Update python doc for MultiVector data type Issue link:#1679 ### Type of change - [x] Documentation Update --------- Co-authored-by: writinwaters <93570324+writinwaters@users.noreply.github.com>
1 parent b2a8b98 commit 514cb48

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

docs/references/pysdk_api_reference.md

+31-6
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ db_object.create_table("my_table", {"c1": {"type": "int", "default": 1}})
386386
# The `create_table`method supports creating float columns in the following data types:
387387
# - float/float32
388388
# - double/float64
389+
# - float16
390+
# - bfloat16
389391
db_object.create_table("my_table", {"c1": {"type": "float64"}})
390392
```
391393

@@ -403,17 +405,40 @@ db_object.create_table("my_table", {"c1": {"type": "bool"}})
403405

404406
#### Create a table with a vector column only
405407

408+
:::tip NOTE
409+
You can build a HNSW index on the vector column to speed up the match_dense search.
410+
:::
411+
406412
```python
407413
# Create a table with a vector column only:
408414
# - `vector`: The column is a vector column
409415
# - `128`: The vector dimension
410-
# - `float`: The primitive data type of the vectors. Can be `float`/`float32` or `double`/`float64`
416+
# - `float`: The primitive data type of the vectors. Can be `float`/`float32`, `float16`, `bfloat16`, `uint8` or `int8`
411417
db_object.create_table("my_table", {"c1": {"type": "vector,128,float"}}, None)
412418

413419
```
414420

421+
#### Create a table with a multi-vector column only
422+
423+
:::tip NOTE
424+
You can build an HNSW index on the multi-vector column to accelerate match_dense search.
425+
:::
426+
427+
```python
428+
# Create a table with a multi-vector column only:
429+
# - `multivector`: The column is a multi-vector column
430+
# - `128`: The basic vector dimension
431+
# - `float`: The primitive data type of the basic vectors. Can be `float`/`float32`, `float16`, `bfloat16`, `uint8` or `int8`
432+
db_object.create_table("my_table", {"c1": {"type": "multivector,128,float"}}, None)
433+
434+
```
435+
415436
#### Create a table with a sparse vector column only
416437

438+
:::tip NOTE
439+
You can build a BMP index on the sparse vector column to speed up the match_sparse search.
440+
:::
441+
417442
```python
418443
from infinity.common import ConflictType
419444
# Create a table with a vector column only:
@@ -431,8 +456,8 @@ from infinity.common import ConflictType
431456
# Create a table with a tensor column only:
432457
# - `tensor`: The column is a tensor column
433458
# - `4`: Dimension of each vector unit in the tensor
434-
# - `float64`: The primitive data type of the tensors. Can be `float`/`float32` or `double`/`float64`
435-
db_object.create_table("my_table", {"c1": {"type": "tensor,4,float64"}}, ConflictType.Ignore)
459+
# - `float`: The primitive data type of the tensors. Can be `float`/`float32`, `float16`, `bfloat16` or `bit`
460+
db_object.create_table("my_table", {"c1": {"type": "tensor,4,float"}}, ConflictType.Ignore)
436461
```
437462

438463
#### Create a table with a tensor array column only
@@ -442,7 +467,7 @@ from infinity.common import ConflictType
442467
# Create a table with a tensor array column only:
443468
# - `tensorarray`: The column is a tensor array column
444469
# - `6`: Dimension of each vector unit in the tensor arrays
445-
# - `float`: The primitive data type of the tensor arrays. Can be `float`/`float32` or `double`/`float64`
470+
# - `float`: The primitive data type of the tensor arrays. Can be `float`/`float32`, `float16`, `bfloat16` or `bit`
446471
db_object.create_table("my_table", {"c1": {"type": "tensorarray,6,float"}}, ConflictType.Ignore)
447472
```
448473

@@ -1469,7 +1494,7 @@ table_object.output(["*"]).filter("c2 = 3").to_pl()
14691494
table_object.match_dense(vector_column_name, embedding_data, embedding_data_type, distance_type, topn, knn_params = None)
14701495
```
14711496

1472-
Creates a dense vector search expression to identify the top n closest rows to the given dense vector. Suitable for working with dense vectors (dense embeddings).
1497+
Creates a dense vector search expression to identify the top n closest rows to the given dense vector. Suitable for working with dense vectors (dense embeddings) or multi-vectors (multiple dense embeddings in one row).
14731498

14741499
:::tip NOTE
14751500
To display your query results, you must chain this method with `output(columns)`, which specifies the columns to output, and a method such as `to_pl()`, `to_df()`, or `to_arrow()` to format the query results.
@@ -1479,7 +1504,7 @@ To display your query results, you must chain this method with `output(columns)`
14791504

14801505
#### vector_column_name: `str`, *Required*
14811506

1482-
A non-empty string indicating the name of the vector column to search on.
1507+
A non-empty string indicating the name of the vector column or multi-vector column to search on.
14831508

14841509
#### embedding_data: `list/np.ndarray`, *Required*
14851510

0 commit comments

Comments
 (0)