pyvastbase 0.2.6__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/MANIFEST.in +5 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/PKG-INFO +39 -28
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/README.md +36 -27
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/README_en.md +35 -28
- pyvastbase-0.2.9/__init__.py +435 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/async_impl/__init__.py +76 -43
- pyvastbase-0.2.9/async_impl/client.py +855 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/async_impl/collection.py +624 -178
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/async_impl/connections.py +230 -60
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/async_impl/index_builder.py +34 -11
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/async_impl/search_builder.py +71 -51
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/async_impl/utility.py +651 -42
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/client.py +573 -105
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/collection.py +488 -90
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/collection_core.py +43 -28
- pyvastbase-0.2.9/core/compat.py +108 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/connections.py +316 -73
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/constants.py +55 -35
- pyvastbase-0.2.9/core/dataframe_schema.py +158 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/exceptions.py +231 -166
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/mutation_result.py +59 -8
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/schema.py +312 -69
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/search_result.py +6 -2
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/vector_types.py +33 -8
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/executor/async_impl.py +22 -2
- pyvastbase-0.2.9/index/index_builder.py +661 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/__init__.py +34 -33
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/admin.py +33 -31
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/ddl.py +37 -3
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/index.py +30 -7
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/insert.py +2 -4
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/query.py +3 -5
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/result.py +3 -3
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/schema_reflect.py +2 -2
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/search_result.py +2 -2
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/upsert.py +1 -5
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/orm/__init__.py +11 -13
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/orm/base.py +183 -196
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/orm/fields.py +43 -37
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/pyproject.toml +3 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/pyvastbase.egg-info/SOURCES.txt +30 -2
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/search/search_builder.py +693 -691
- pyvastbase-0.2.9/test_conn.py +27 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/conftest.py +45 -53
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/helpers.py +3 -3
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_async.py +523 -249
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_async_alignment.py +25 -8
- pyvastbase-0.2.9/tests/test_async_alter_field_collection_stats_compat.py +329 -0
- pyvastbase-0.2.9/tests/test_async_collection_search_iterator.py +81 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_async_executor.py +6 -2
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_async_integration.py +19 -16
- pyvastbase-0.2.9/tests/test_async_mirrors_compat.py +728 -0
- pyvastbase-0.2.9/tests/test_async_vastbase_client_compat.py +784 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_async_with_executor.py +15 -10
- pyvastbase-0.2.9/tests/test_client_aliases_factories_compat.py +251 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_client_compat.py +70 -3
- pyvastbase-0.2.9/tests/test_client_missing_methods_compat.py +338 -0
- pyvastbase-0.2.9/tests/test_client_partition_names_compat.py +327 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_collection.py +276 -201
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_collection_adapter.py +14 -4
- pyvastbase-0.2.9/tests/test_collection_construct_from_dataframe.py +353 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_collection_core.py +54 -25
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_collection_integration.py +30 -22
- pyvastbase-0.2.9/tests/test_collection_orm_delegates_compat.py +487 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_collection_properties.py +18 -17
- pyvastbase-0.2.9/tests/test_collection_schema_construct_from_dict.py +256 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_collection_signatures.py +39 -17
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_connection_alignment.py +8 -2
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_connection_provider.py +2 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_connections.py +187 -32
- pyvastbase-0.2.9/tests/test_connections_compat_shims.py +405 -0
- pyvastbase-0.2.9/tests/test_connections_get_connection_addr_compat.py +91 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_constants.py +24 -22
- pyvastbase-0.2.9/tests/test_create_index_compat.py +506 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_datatype_compat.py +3 -1
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_datatype_intenum.py +24 -1
- pyvastbase-0.2.9/tests/test_datatype_mapping.py +132 -0
- pyvastbase-0.2.9/tests/test_datatype_value_bridge.py +168 -0
- pyvastbase-0.2.9/tests/test_drop_index_compat.py +161 -0
- pyvastbase-0.2.9/tests/test_exception_aliases.py +205 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_exceptions.py +32 -32
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_executor.py +5 -7
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_exports.py +27 -12
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_hybrid_search.py +23 -16
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_index_builder.py +153 -45
- pyvastbase-0.2.9/tests/test_init_exports_compat.py +266 -0
- pyvastbase-0.2.9/tests/test_insert_upsert_compat.py +180 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_integration.py +30 -33
- pyvastbase-0.2.9/tests/test_iterator_next_method.py +241 -0
- pyvastbase-0.2.9/tests/test_list_indexes_field_filter_compat.py +295 -0
- pyvastbase-0.2.9/tests/test_migration_doc_claims.py +783 -0
- pyvastbase-0.2.9/tests/test_mutation_result.py +229 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_operations.py +34 -16
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_operations_compat.py +18 -13
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_orm.py +173 -133
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_parameter_unification.py +12 -3
- pyvastbase-0.2.9/tests/test_pool_del_repro.py +216 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_return_type_rename.py +20 -4
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_schema.py +115 -138
- pyvastbase-0.2.9/tests/test_schema_alignment.py +612 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_search_builder.py +86 -56
- pyvastbase-0.2.9/tests/test_search_iterator_round_decimal.py +218 -0
- pyvastbase-0.2.9/tests/test_search_query_delete_dualname.py +610 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_type_alignment.py +26 -8
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_utility.py +84 -82
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_utility_compat.py +24 -13
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_utility_integration.py +54 -35
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_utils.py +735 -336
- pyvastbase-0.2.9/tests/test_vastbase_client.py +283 -0
- pyvastbase-0.2.9/tests/test_vector_operator_mapping.py +42 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_vector_types.py +27 -14
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_with_executor.py +28 -27
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utility.py +649 -304
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utils/__init__.py +61 -57
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utils/distance_utils.py +95 -106
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utils/filter_utils.py +48 -47
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utils/index_utils.py +68 -77
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utils/result_utils.py +125 -118
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utils/sql_utils.py +15 -10
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/utils/vector_utils.py +134 -162
- pyvastbase-0.2.6/CLAUDE.md +0 -111
- pyvastbase-0.2.6/CONTEXT.md +0 -79
- pyvastbase-0.2.6/__init__.py +0 -364
- pyvastbase-0.2.6/index/index_builder.py +0 -485
- pyvastbase-0.2.6/test_conn.py +0 -17
- pyvastbase-0.2.6/tests/test_datatype_mapping.py +0 -109
- pyvastbase-0.2.6/tests/test_exception_aliases.py +0 -44
- pyvastbase-0.2.6/tests/test_mutation_result.py +0 -123
- pyvastbase-0.2.6/tests/test_schema_alignment.py +0 -152
- pyvastbase-0.2.6/tests/test_vastbase_client.py +0 -107
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/__init__.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/core/executor.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/executor/__init__.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/executor/sync.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/index/__init__.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/delete.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/operations/search.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/search/__init__.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/setup.cfg +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/__init__.py +0 -0
- {pyvastbase-0.2.6 → pyvastbase-0.2.9}/tests/test_packaging.py +0 -0
|
@@ -18,5 +18,10 @@ prune .ruff_cache
|
|
|
18
18
|
prune .coverage
|
|
19
19
|
prune .claude
|
|
20
20
|
prune .scratch
|
|
21
|
+
# Internal dev-convention docs — not shipped in the published package
|
|
22
|
+
exclude CLAUDE.md
|
|
23
|
+
exclude CONTEXT.md
|
|
24
|
+
prune docs/adr
|
|
25
|
+
prune docs/agents
|
|
21
26
|
global-exclude *.pyc
|
|
22
27
|
global-exclude __pycache__
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyvastbase
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Python SDK for Vastbase V3 (PyMilvus-style API)
|
|
5
5
|
Author-email: "zhangzhijie(字节)" <zhangzj@vastdata.com.cn>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -21,6 +21,7 @@ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
|
21
21
|
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
22
22
|
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
23
23
|
Requires-Dist: mypy>=1.5.0; extra == "dev"
|
|
24
|
+
Requires-Dist: vermin>=1.6; extra == "dev"
|
|
24
25
|
Provides-Extra: pool
|
|
25
26
|
Requires-Dist: psycopg-pool>=3.2; extra == "pool"
|
|
26
27
|
Provides-Extra: async
|
|
@@ -32,11 +33,12 @@ Requires-Dist: pytest-cov>=4.1.0; extra == "all"
|
|
|
32
33
|
Requires-Dist: black>=23.0.0; extra == "all"
|
|
33
34
|
Requires-Dist: isort>=5.12.0; extra == "all"
|
|
34
35
|
Requires-Dist: mypy>=1.5.0; extra == "all"
|
|
36
|
+
Requires-Dist: vermin>=1.6; extra == "all"
|
|
35
37
|
Requires-Dist: psycopg-pool>=3.2; extra == "all"
|
|
36
38
|
|
|
37
39
|
# pyvastbase
|
|
38
40
|
|
|
39
|
-
Python SDK for Vastbase
|
|
41
|
+
Python SDK for Vastbase 向量引擎 — 对标 PyMilvus 接口风格。支持 Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2,自动识别产品线并映射版本,对 3.0.9+ 新特性自动版本检测与功能门控。
|
|
40
42
|
|
|
41
43
|
## 安装
|
|
42
44
|
|
|
@@ -70,7 +72,10 @@ results = client.search("my_vectors", data=[0.15] * 128, limit=5)
|
|
|
70
72
|
db_info = client.describe_database("vastbase")
|
|
71
73
|
print(db_info) # {'name': 'vastbase', 'table_count': 5, ...}
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
# 多路向量召回 + 重排序(pymilvus 兼容)
|
|
76
|
+
from pyvastbase import AnnSearchRequest, RRFRanker
|
|
77
|
+
req = AnnSearchRequest(data=[0.15] * 128, anns_field="embedding", limit=20)
|
|
78
|
+
results = client.hybrid_search("my_vectors", reqs=[req], ranker=RRFRanker(), limit=20)
|
|
74
79
|
```
|
|
75
80
|
|
|
76
81
|
### 方式二:传统 Collection 风格
|
|
@@ -150,19 +155,23 @@ col.insert([{
|
|
|
150
155
|
|
|
151
156
|
## 版本检测与自动门控
|
|
152
157
|
|
|
153
|
-
SDK 通过 `SELECT vb_version()`
|
|
158
|
+
SDK 通过 `SELECT vb_version()` 自动检测已连接的产品及版本,并对 3.0.9+ 特性进行功能门控。支持三种产品线,自动映射到统一的 V3 等效版本号。版本信息**按连接缓存**——仅查询一次,后续所有检查复用缓存结果。
|
|
154
159
|
|
|
155
|
-
###
|
|
160
|
+
### 多产品支持
|
|
156
161
|
|
|
157
|
-
|
|
162
|
+
SDK 根据 `vb_version()` 输出中的 `product name:` 行自动识别产品,并应用对应的版本映射:
|
|
158
163
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
| 产品 | product name 标识 | 版本格式 | 示例 |
|
|
165
|
+
|------|-------------------|----------|------|
|
|
166
|
+
| Vastbase V3 | 默认 / Vastbase V100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V3.0 (Build 9) + patch:1` |
|
|
167
|
+
| VexDB Enterprise Edition | VexDB Enterprise Edition | `V<M>.<m>.<B>.<P>` 四段式 | `V3.0.0.3` |
|
|
168
|
+
| Vastbase G100 V2.2 | Vastbase G100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V2.2 (Build 19) + patch:6` |
|
|
169
|
+
|
|
170
|
+
所有产品线的版本号均映射为 V3 等效 `(major, minor, build, patch_level)` 元组,功能门控统一使用映射后的值。
|
|
171
|
+
|
|
172
|
+
### 双重校验:Build + Patch(来自 vb_version())
|
|
164
173
|
|
|
165
|
-
功能门控**同时检查**两个条件:`build >=
|
|
174
|
+
功能门控**同时检查**两个条件:`build >= required_build AND patch_level >= required_patch`。
|
|
166
175
|
|
|
167
176
|
```python
|
|
168
177
|
from pyvastbase import get_vb_version, check_vb_version
|
|
@@ -170,15 +179,16 @@ from pyvastbase import get_vb_version, check_vb_version
|
|
|
170
179
|
ver = get_vb_version()
|
|
171
180
|
print(ver["major"]) # 3
|
|
172
181
|
print(ver["minor"]) # 0
|
|
173
|
-
print(ver["build"]) # 9
|
|
174
|
-
print(ver["patch_level"]) # 1
|
|
182
|
+
print(ver["build"]) # 9
|
|
183
|
+
print(ver["patch_level"]) # 1
|
|
184
|
+
print(ver["product_name"]) # "VexDB Enterprise Edition"
|
|
185
|
+
print(ver["commit"]) # "31338"
|
|
175
186
|
print(ver["has_sparsevector"]) # True (build>=9 AND patch_level>=1)
|
|
176
187
|
print(ver["has_int8vector"]) # True
|
|
177
188
|
|
|
178
|
-
# 手动版本检查 (major, minor, build, patch_level)
|
|
179
|
-
check_vb_version((3, 0, 9, 1)) # True —
|
|
189
|
+
# 手动版本检查 (major, minor, build, patch_level) — 使用映射后的 V3 等效版本
|
|
190
|
+
check_vb_version((3, 0, 9, 1)) # True — 所有产品线统一检查
|
|
180
191
|
check_vb_version((3, 0, 9, 2)) # False — patch 1 < 2
|
|
181
|
-
check_vb_version((3, 0, 8, 1)) # True — 服务器版本高于最低要求
|
|
182
192
|
```
|
|
183
193
|
|
|
184
194
|
所有 3.0.9+ 操作在执行前会**自动校验**服务器版本。若服务器版本过低,会返回具体的错误信息,明确指出哪个条件未满足。
|
|
@@ -231,12 +241,12 @@ results = bm25_search_highlight(
|
|
|
231
241
|
# 返回: ['<b>向量</b>数据库是AI应用的核心', ...]
|
|
232
242
|
```
|
|
233
243
|
|
|
234
|
-
##
|
|
244
|
+
## 混合 ANN 搜索(hybrid_ann_search)
|
|
235
245
|
|
|
236
|
-
|
|
246
|
+
Vastbase 原生单向量相似度 + 标量字段过滤(HybridANN 索引),实现灵活的复合查询:
|
|
237
247
|
|
|
238
248
|
```python
|
|
239
|
-
results = col.
|
|
249
|
+
results = col.hybrid_ann_search(
|
|
240
250
|
data=[0.1] * 128,
|
|
241
251
|
filter={
|
|
242
252
|
"$and": [
|
|
@@ -266,7 +276,7 @@ for buf in bulkbuffer_inspect():
|
|
|
266
276
|
|
|
267
277
|
## MutationResult
|
|
268
278
|
|
|
269
|
-
所有变更操作返回 `MutationResultWrapper
|
|
279
|
+
所有变更操作返回 `MutationResult`,支持列表访问和结构化字段(`MutationResultWrapper` 为废弃别名,访问会触发 `DeprecationWarning`,但仍可用):
|
|
270
280
|
|
|
271
281
|
```python
|
|
272
282
|
result = col.insert([{"id": 1, "embedding": [0.1] * 128, "text": "hello"}])
|
|
@@ -382,7 +392,7 @@ except ConnectionError:
|
|
|
382
392
|
| [ORM](docs/api-reference_zh.md#orm) | Entity, Model, Field, VectorField |
|
|
383
393
|
| [Exceptions](docs/api-reference_zh.md#exceptions) | VastbaseException 继承层次 |
|
|
384
394
|
| [Async API](docs/api-reference_zh.md#async-api) | AsyncCollection, AsyncConnections |
|
|
385
|
-
| [MutationResult](docs/api-reference_zh.md#mutationresult) | MutationResult
|
|
395
|
+
| [MutationResult](docs/api-reference_zh.md#mutationresult) | MutationResult(MutationResultWrapper 为废弃别名) |
|
|
386
396
|
|
|
387
397
|
## 快速 API 参考
|
|
388
398
|
|
|
@@ -436,12 +446,13 @@ col.create()
|
|
|
436
446
|
col.drop()
|
|
437
447
|
col.exists()
|
|
438
448
|
col.truncate()
|
|
439
|
-
col.insert(data, normalize_vectors=False) # ->
|
|
449
|
+
col.insert(data, normalize_vectors=False) # -> MutationResult
|
|
440
450
|
col.batch_insert(data, batch_size=100)
|
|
441
451
|
col.delete(expr="id > 10") | delete(pks=[1, 2, 3])
|
|
442
452
|
col.upsert(data)
|
|
443
453
|
col.search(data, anns_field, param, limit, expr, output_fields)
|
|
444
|
-
col.hybrid_search(
|
|
454
|
+
col.hybrid_search(reqs, rerank, limit, output_fields)
|
|
455
|
+
col.hybrid_ann_search(data, anns_field, param, limit, filter, output_fields)
|
|
445
456
|
col.query(expr="id < 100", limit=10, offset=0, batch_size=None)
|
|
446
457
|
col.get(ids=[1, 2, 3])
|
|
447
458
|
col.num_entities / col.is_empty
|
|
@@ -493,7 +504,7 @@ get_config() # -> {"default_connection": "default", "timeout": 30.0, ...}
|
|
|
493
504
|
以下功能已与 pymilvus API 对齐:
|
|
494
505
|
|
|
495
506
|
- **DataType IntEnum** — 所有标量和向量类型使用 IntEnum,与 pymilvus 枚举值兼容
|
|
496
|
-
- **MutationResult** — `insert`/`upsert`/`delete` 返回 `
|
|
507
|
+
- **MutationResult** — `insert`/`upsert`/`delete` 返回 `MutationResult`,支持列表访问和结构化字段(`insert_count`, `delete_count`, `primary_keys`);`MutationResultWrapper` 为废弃别名
|
|
497
508
|
- **SearchResult** — 搜索结果结构与 pymilvus 一致,支持 `result.id`, `result.distance`, `result.data`
|
|
498
509
|
- **connect(uri)** — 支持通过 URI 连接字符串连接(`postgresql://user:pass@host:port/db`)
|
|
499
510
|
- **hybrid_search** — SDK 层多路向量召回 + RRF/WeightedRRF/WeightedRanker 重排序(pymilvus 兼容 API)
|
|
@@ -558,7 +569,7 @@ pyvastbase/
|
|
|
558
569
|
│ ├── constants.py # IndexType, DistanceType, 版本常量, 算子映射
|
|
559
570
|
│ ├── connections.py # ConnectionConfig, VastbaseConnection (含版本缓存)
|
|
560
571
|
│ ├── exceptions.py # 19 个异常类
|
|
561
|
-
│ ├── mutation_result.py # MutationResult
|
|
572
|
+
│ ├── mutation_result.py # MutationResult(含 MutationResultWrapper 废弃别名)
|
|
562
573
|
│ └── schema.py # FieldSchema, CollectionSchema, DataType
|
|
563
574
|
├── collection.py # Collection 类,完整的 CRUD、搜索、索引操作
|
|
564
575
|
├── utility.py # 50+ 工具函数:用户/数据库/权限, flush/compact, 3.0.9+特性
|
|
@@ -569,7 +580,7 @@ pyvastbase/
|
|
|
569
580
|
├── utils/ # SQL 生成, 向量/距离/过滤/结果工具
|
|
570
581
|
├── orm/ # Entity/Model ORM 层 (Django 风格装饰器)
|
|
571
582
|
├── async_impl/ # AsyncCollection 等异步对应实现
|
|
572
|
-
├── tests/ #
|
|
583
|
+
├── tests/ # 1700+ 测试覆盖所有模块
|
|
573
584
|
└── docs/
|
|
574
585
|
├── api-reference.md # 完整 API 参考(英文)
|
|
575
586
|
└── api-reference_zh.md # 完整 API 参考(简体中文)
|
|
@@ -579,7 +590,7 @@ pyvastbase/
|
|
|
579
590
|
|
|
580
591
|
- Python >= 3.9
|
|
581
592
|
- psycopg[binary] >= 3.2
|
|
582
|
-
- Vastbase
|
|
593
|
+
- Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2(新向量类型和特性需要 3.0.9+)
|
|
583
594
|
|
|
584
595
|
## License
|
|
585
596
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pyvastbase
|
|
2
2
|
|
|
3
|
-
Python SDK for Vastbase
|
|
3
|
+
Python SDK for Vastbase 向量引擎 — 对标 PyMilvus 接口风格。支持 Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2,自动识别产品线并映射版本,对 3.0.9+ 新特性自动版本检测与功能门控。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -34,7 +34,10 @@ results = client.search("my_vectors", data=[0.15] * 128, limit=5)
|
|
|
34
34
|
db_info = client.describe_database("vastbase")
|
|
35
35
|
print(db_info) # {'name': 'vastbase', 'table_count': 5, ...}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
# 多路向量召回 + 重排序(pymilvus 兼容)
|
|
38
|
+
from pyvastbase import AnnSearchRequest, RRFRanker
|
|
39
|
+
req = AnnSearchRequest(data=[0.15] * 128, anns_field="embedding", limit=20)
|
|
40
|
+
results = client.hybrid_search("my_vectors", reqs=[req], ranker=RRFRanker(), limit=20)
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
### 方式二:传统 Collection 风格
|
|
@@ -114,19 +117,23 @@ col.insert([{
|
|
|
114
117
|
|
|
115
118
|
## 版本检测与自动门控
|
|
116
119
|
|
|
117
|
-
SDK 通过 `SELECT vb_version()`
|
|
120
|
+
SDK 通过 `SELECT vb_version()` 自动检测已连接的产品及版本,并对 3.0.9+ 特性进行功能门控。支持三种产品线,自动映射到统一的 V3 等效版本号。版本信息**按连接缓存**——仅查询一次,后续所有检查复用缓存结果。
|
|
118
121
|
|
|
119
|
-
###
|
|
122
|
+
### 多产品支持
|
|
120
123
|
|
|
121
|
-
|
|
124
|
+
SDK 根据 `vb_version()` 输出中的 `product name:` 行自动识别产品,并应用对应的版本映射:
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
| 产品 | product name 标识 | 版本格式 | 示例 |
|
|
127
|
+
|------|-------------------|----------|------|
|
|
128
|
+
| Vastbase V3 | 默认 / Vastbase V100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V3.0 (Build 9) + patch:1` |
|
|
129
|
+
| VexDB Enterprise Edition | VexDB Enterprise Edition | `V<M>.<m>.<B>.<P>` 四段式 | `V3.0.0.3` |
|
|
130
|
+
| Vastbase G100 V2.2 | Vastbase G100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V2.2 (Build 19) + patch:6` |
|
|
131
|
+
|
|
132
|
+
所有产品线的版本号均映射为 V3 等效 `(major, minor, build, patch_level)` 元组,功能门控统一使用映射后的值。
|
|
133
|
+
|
|
134
|
+
### 双重校验:Build + Patch(来自 vb_version())
|
|
128
135
|
|
|
129
|
-
功能门控**同时检查**两个条件:`build >=
|
|
136
|
+
功能门控**同时检查**两个条件:`build >= required_build AND patch_level >= required_patch`。
|
|
130
137
|
|
|
131
138
|
```python
|
|
132
139
|
from pyvastbase import get_vb_version, check_vb_version
|
|
@@ -134,15 +141,16 @@ from pyvastbase import get_vb_version, check_vb_version
|
|
|
134
141
|
ver = get_vb_version()
|
|
135
142
|
print(ver["major"]) # 3
|
|
136
143
|
print(ver["minor"]) # 0
|
|
137
|
-
print(ver["build"]) # 9
|
|
138
|
-
print(ver["patch_level"]) # 1
|
|
144
|
+
print(ver["build"]) # 9
|
|
145
|
+
print(ver["patch_level"]) # 1
|
|
146
|
+
print(ver["product_name"]) # "VexDB Enterprise Edition"
|
|
147
|
+
print(ver["commit"]) # "31338"
|
|
139
148
|
print(ver["has_sparsevector"]) # True (build>=9 AND patch_level>=1)
|
|
140
149
|
print(ver["has_int8vector"]) # True
|
|
141
150
|
|
|
142
|
-
# 手动版本检查 (major, minor, build, patch_level)
|
|
143
|
-
check_vb_version((3, 0, 9, 1)) # True —
|
|
151
|
+
# 手动版本检查 (major, minor, build, patch_level) — 使用映射后的 V3 等效版本
|
|
152
|
+
check_vb_version((3, 0, 9, 1)) # True — 所有产品线统一检查
|
|
144
153
|
check_vb_version((3, 0, 9, 2)) # False — patch 1 < 2
|
|
145
|
-
check_vb_version((3, 0, 8, 1)) # True — 服务器版本高于最低要求
|
|
146
154
|
```
|
|
147
155
|
|
|
148
156
|
所有 3.0.9+ 操作在执行前会**自动校验**服务器版本。若服务器版本过低,会返回具体的错误信息,明确指出哪个条件未满足。
|
|
@@ -195,12 +203,12 @@ results = bm25_search_highlight(
|
|
|
195
203
|
# 返回: ['<b>向量</b>数据库是AI应用的核心', ...]
|
|
196
204
|
```
|
|
197
205
|
|
|
198
|
-
##
|
|
206
|
+
## 混合 ANN 搜索(hybrid_ann_search)
|
|
199
207
|
|
|
200
|
-
|
|
208
|
+
Vastbase 原生单向量相似度 + 标量字段过滤(HybridANN 索引),实现灵活的复合查询:
|
|
201
209
|
|
|
202
210
|
```python
|
|
203
|
-
results = col.
|
|
211
|
+
results = col.hybrid_ann_search(
|
|
204
212
|
data=[0.1] * 128,
|
|
205
213
|
filter={
|
|
206
214
|
"$and": [
|
|
@@ -230,7 +238,7 @@ for buf in bulkbuffer_inspect():
|
|
|
230
238
|
|
|
231
239
|
## MutationResult
|
|
232
240
|
|
|
233
|
-
所有变更操作返回 `MutationResultWrapper
|
|
241
|
+
所有变更操作返回 `MutationResult`,支持列表访问和结构化字段(`MutationResultWrapper` 为废弃别名,访问会触发 `DeprecationWarning`,但仍可用):
|
|
234
242
|
|
|
235
243
|
```python
|
|
236
244
|
result = col.insert([{"id": 1, "embedding": [0.1] * 128, "text": "hello"}])
|
|
@@ -346,7 +354,7 @@ except ConnectionError:
|
|
|
346
354
|
| [ORM](docs/api-reference_zh.md#orm) | Entity, Model, Field, VectorField |
|
|
347
355
|
| [Exceptions](docs/api-reference_zh.md#exceptions) | VastbaseException 继承层次 |
|
|
348
356
|
| [Async API](docs/api-reference_zh.md#async-api) | AsyncCollection, AsyncConnections |
|
|
349
|
-
| [MutationResult](docs/api-reference_zh.md#mutationresult) | MutationResult
|
|
357
|
+
| [MutationResult](docs/api-reference_zh.md#mutationresult) | MutationResult(MutationResultWrapper 为废弃别名) |
|
|
350
358
|
|
|
351
359
|
## 快速 API 参考
|
|
352
360
|
|
|
@@ -400,12 +408,13 @@ col.create()
|
|
|
400
408
|
col.drop()
|
|
401
409
|
col.exists()
|
|
402
410
|
col.truncate()
|
|
403
|
-
col.insert(data, normalize_vectors=False) # ->
|
|
411
|
+
col.insert(data, normalize_vectors=False) # -> MutationResult
|
|
404
412
|
col.batch_insert(data, batch_size=100)
|
|
405
413
|
col.delete(expr="id > 10") | delete(pks=[1, 2, 3])
|
|
406
414
|
col.upsert(data)
|
|
407
415
|
col.search(data, anns_field, param, limit, expr, output_fields)
|
|
408
|
-
col.hybrid_search(
|
|
416
|
+
col.hybrid_search(reqs, rerank, limit, output_fields)
|
|
417
|
+
col.hybrid_ann_search(data, anns_field, param, limit, filter, output_fields)
|
|
409
418
|
col.query(expr="id < 100", limit=10, offset=0, batch_size=None)
|
|
410
419
|
col.get(ids=[1, 2, 3])
|
|
411
420
|
col.num_entities / col.is_empty
|
|
@@ -457,7 +466,7 @@ get_config() # -> {"default_connection": "default", "timeout": 30.0, ...}
|
|
|
457
466
|
以下功能已与 pymilvus API 对齐:
|
|
458
467
|
|
|
459
468
|
- **DataType IntEnum** — 所有标量和向量类型使用 IntEnum,与 pymilvus 枚举值兼容
|
|
460
|
-
- **MutationResult** — `insert`/`upsert`/`delete` 返回 `
|
|
469
|
+
- **MutationResult** — `insert`/`upsert`/`delete` 返回 `MutationResult`,支持列表访问和结构化字段(`insert_count`, `delete_count`, `primary_keys`);`MutationResultWrapper` 为废弃别名
|
|
461
470
|
- **SearchResult** — 搜索结果结构与 pymilvus 一致,支持 `result.id`, `result.distance`, `result.data`
|
|
462
471
|
- **connect(uri)** — 支持通过 URI 连接字符串连接(`postgresql://user:pass@host:port/db`)
|
|
463
472
|
- **hybrid_search** — SDK 层多路向量召回 + RRF/WeightedRRF/WeightedRanker 重排序(pymilvus 兼容 API)
|
|
@@ -522,7 +531,7 @@ pyvastbase/
|
|
|
522
531
|
│ ├── constants.py # IndexType, DistanceType, 版本常量, 算子映射
|
|
523
532
|
│ ├── connections.py # ConnectionConfig, VastbaseConnection (含版本缓存)
|
|
524
533
|
│ ├── exceptions.py # 19 个异常类
|
|
525
|
-
│ ├── mutation_result.py # MutationResult
|
|
534
|
+
│ ├── mutation_result.py # MutationResult(含 MutationResultWrapper 废弃别名)
|
|
526
535
|
│ └── schema.py # FieldSchema, CollectionSchema, DataType
|
|
527
536
|
├── collection.py # Collection 类,完整的 CRUD、搜索、索引操作
|
|
528
537
|
├── utility.py # 50+ 工具函数:用户/数据库/权限, flush/compact, 3.0.9+特性
|
|
@@ -533,7 +542,7 @@ pyvastbase/
|
|
|
533
542
|
├── utils/ # SQL 生成, 向量/距离/过滤/结果工具
|
|
534
543
|
├── orm/ # Entity/Model ORM 层 (Django 风格装饰器)
|
|
535
544
|
├── async_impl/ # AsyncCollection 等异步对应实现
|
|
536
|
-
├── tests/ #
|
|
545
|
+
├── tests/ # 1700+ 测试覆盖所有模块
|
|
537
546
|
└── docs/
|
|
538
547
|
├── api-reference.md # 完整 API 参考(英文)
|
|
539
548
|
└── api-reference_zh.md # 完整 API 参考(简体中文)
|
|
@@ -543,7 +552,7 @@ pyvastbase/
|
|
|
543
552
|
|
|
544
553
|
- Python >= 3.9
|
|
545
554
|
- psycopg[binary] >= 3.2
|
|
546
|
-
- Vastbase
|
|
555
|
+
- Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2(新向量类型和特性需要 3.0.9+)
|
|
547
556
|
|
|
548
557
|
## License
|
|
549
558
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pyvastbase
|
|
2
2
|
|
|
3
|
-
Python SDK for Vastbase
|
|
3
|
+
Python SDK for Vastbase vector engine — a PyMilvus-style API. Supports Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2 with automatic product detection, version mapping, and feature gating for 3.0.9+ features.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -30,7 +30,10 @@ results = client.search("my_vectors", data=[0.15] * 128, limit=5)
|
|
|
30
30
|
db_info = client.describe_database("vastbase")
|
|
31
31
|
print(db_info) # {'name': 'vastbase', 'table_count': 5, ...}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
# Multi-way vector recall + reranking (pymilvus-compatible)
|
|
34
|
+
from pyvastbase import AnnSearchRequest, RRFRanker
|
|
35
|
+
req = AnnSearchRequest(data=[0.15] * 128, anns_field="embedding", limit=20)
|
|
36
|
+
results = client.hybrid_search("my_vectors", reqs=[req], ranker=RRFRanker(), limit=20)
|
|
34
37
|
```
|
|
35
38
|
|
|
36
39
|
### Traditional Collection-based
|
|
@@ -110,19 +113,21 @@ col.insert([{
|
|
|
110
113
|
|
|
111
114
|
## Version Detection & Auto-Gating
|
|
112
115
|
|
|
113
|
-
The SDK automatically detects the connected
|
|
116
|
+
The SDK automatically detects the connected product and version via `SELECT vb_version()`. Three product lines are recognized through the `product name:` line, with versions mapped to canonical V3-equivalent `(major, minor, build, patch_level)` tuples. The version is **cached per connection** — only one query, reused for all subsequent checks.
|
|
114
117
|
|
|
115
|
-
###
|
|
118
|
+
### Multi-Product Support
|
|
116
119
|
|
|
117
|
-
|
|
120
|
+
| Product | product name | Version Format | Example |
|
|
121
|
+
|---------|-------------|----------------|---------|
|
|
122
|
+
| Vastbase V3 | default / Vastbase V100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V3.0 (Build 9) + patch:1` |
|
|
123
|
+
| VexDB Enterprise Edition | VexDB Enterprise Edition | `V<M>.<m>.<B>.<P>` 4-segment | `V3.0.0.3` |
|
|
124
|
+
| Vastbase G100 V2.2 | Vastbase G100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V2.2 (Build 19) + patch:6` |
|
|
118
125
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
patch:1 -> patch_level = 1
|
|
123
|
-
```
|
|
126
|
+
All products are mapped to canonical V3-equivalent versions for unified feature gating.
|
|
127
|
+
|
|
128
|
+
### Dual-Check: Build + Patch
|
|
124
129
|
|
|
125
|
-
Feature gating checks **both** conditions: `build >=
|
|
130
|
+
Feature gating checks **both** conditions: `build >= required_build AND patch_level >= required_patch`.
|
|
126
131
|
|
|
127
132
|
```python
|
|
128
133
|
from pyvastbase import get_vb_version, check_vb_version
|
|
@@ -130,15 +135,16 @@ from pyvastbase import get_vb_version, check_vb_version
|
|
|
130
135
|
ver = get_vb_version()
|
|
131
136
|
print(ver["major"]) # 3
|
|
132
137
|
print(ver["minor"]) # 0
|
|
133
|
-
print(ver["build"]) # 9
|
|
134
|
-
print(ver["patch_level"]) # 1
|
|
138
|
+
print(ver["build"]) # 9
|
|
139
|
+
print(ver["patch_level"]) # 1
|
|
140
|
+
print(ver["product_name"]) # "VexDB Enterprise Edition"
|
|
141
|
+
print(ver["commit"]) # "31338"
|
|
135
142
|
print(ver["has_sparsevector"]) # True (build>=9 AND patch_level>=1)
|
|
136
143
|
print(ver["has_int8vector"]) # True
|
|
137
144
|
|
|
138
|
-
# Manual version check (major, minor, build, patch_level)
|
|
139
|
-
check_vb_version((3, 0, 9, 1)) # True —
|
|
145
|
+
# Manual version check (major, minor, build, patch_level) — uses canonical V3 values
|
|
146
|
+
check_vb_version((3, 0, 9, 1)) # True — works across all product lines
|
|
140
147
|
check_vb_version((3, 0, 9, 2)) # False — patch 1 < 2
|
|
141
|
-
check_vb_version((3, 0, 8, 1)) # True — server exceeds minimum
|
|
142
148
|
```
|
|
143
149
|
|
|
144
150
|
All 3.0.9+ operations automatically validate the server version before executing. If the server is too old, specific error messages indicate which requirement failed.
|
|
@@ -191,12 +197,12 @@ results = bm25_search_highlight(
|
|
|
191
197
|
# Returns: ['<b>向量</b>数据库是AI应用的核心', ...]
|
|
192
198
|
```
|
|
193
199
|
|
|
194
|
-
## Hybrid Search
|
|
200
|
+
## Hybrid ANN Search (hybrid_ann_search)
|
|
195
201
|
|
|
196
|
-
|
|
202
|
+
Vastbase-native single-vector similarity + scalar field filtering (HybridANN index) for flexible queries:
|
|
197
203
|
|
|
198
204
|
```python
|
|
199
|
-
results = col.
|
|
205
|
+
results = col.hybrid_ann_search(
|
|
200
206
|
data=[0.1] * 128,
|
|
201
207
|
filter={
|
|
202
208
|
"$and": [
|
|
@@ -226,7 +232,7 @@ for buf in bulkbuffer_inspect():
|
|
|
226
232
|
|
|
227
233
|
## MutationResult
|
|
228
234
|
|
|
229
|
-
All mutation operations return `
|
|
235
|
+
All mutation operations return a `MutationResult` providing both list access and structured fields (`MutationResultWrapper` is a deprecated alias that still works but emits a `DeprecationWarning`):
|
|
230
236
|
|
|
231
237
|
```python
|
|
232
238
|
result = col.insert([{"id": 1, "embedding": [0.1] * 128, "text": "hello"}])
|
|
@@ -342,7 +348,7 @@ Full API reference: [docs/api-reference.md](docs/api-reference.md)
|
|
|
342
348
|
| [ORM](docs/api-reference.md#orm) | Entity, Model, Field, VectorField |
|
|
343
349
|
| [Exceptions](docs/api-reference.md#exceptions) | VastbaseException hierarchy |
|
|
344
350
|
| [Async API](docs/api-reference.md#async-api) | AsyncCollection, AsyncConnections |
|
|
345
|
-
| [MutationResult](docs/api-reference.md#mutationresult) | MutationResult
|
|
351
|
+
| [MutationResult](docs/api-reference.md#mutationresult) | MutationResult (MutationResultWrapper is a deprecated alias) |
|
|
346
352
|
|
|
347
353
|
## Quick API Reference
|
|
348
354
|
|
|
@@ -396,12 +402,13 @@ col.create()
|
|
|
396
402
|
col.drop()
|
|
397
403
|
col.exists()
|
|
398
404
|
col.truncate()
|
|
399
|
-
col.insert(data, normalize_vectors=False) # ->
|
|
405
|
+
col.insert(data, normalize_vectors=False) # -> MutationResult
|
|
400
406
|
col.batch_insert(data, batch_size=100)
|
|
401
407
|
col.delete(expr="id > 10") | delete(pks=[1, 2, 3])
|
|
402
408
|
col.upsert(data)
|
|
403
409
|
col.search(data, anns_field, param, limit, expr, output_fields)
|
|
404
|
-
col.hybrid_search(
|
|
410
|
+
col.hybrid_search(reqs, rerank, limit, output_fields)
|
|
411
|
+
col.hybrid_ann_search(data, anns_field, param, limit, filter, output_fields)
|
|
405
412
|
col.query(expr="id < 100", limit=10, offset=0, batch_size=None)
|
|
406
413
|
col.get(ids=[1, 2, 3])
|
|
407
414
|
col.num_entities / col.is_empty
|
|
@@ -451,7 +458,7 @@ get_config() # -> {"default_connection": "default", "timeout": 30.0, ...}
|
|
|
451
458
|
### Aligned (matches pymilvus API)
|
|
452
459
|
|
|
453
460
|
- **DataType IntEnum** -- Numeric values match pymilvus (e.g. `FLOAT_VECTOR=16`, `INT64=6`); PG-only types use values >= 100
|
|
454
|
-
- **MutationResult** -- Same `.insert_count`, `.delete_count`, `.upsert_count`, `.primary_keys` fields
|
|
461
|
+
- **MutationResult** -- Same `.insert_count`, `.delete_count`, `.upsert_count`, `.primary_keys` fields with backward-compatible list access (`MutationResultWrapper` is a deprecated alias)
|
|
455
462
|
- **SearchResult** -- Same `.id`, `.distance`, `.entity` attribute pattern on result hits
|
|
456
463
|
- **connect(uri)** -- Accepts PostgreSQL connection URI strings, same parameter pattern as pymilvus `connect()`
|
|
457
464
|
- **hybrid_search** -- SDK-layer multi-way vector recall with RRF/WeightedRRF/WeightedRanker reranking (pymilvus-compatible API; N SQL round trips vs Milvus single gRPC call)
|
|
@@ -520,7 +527,7 @@ pyvastbase/
|
|
|
520
527
|
│ ├── constants.py # IndexType, DistanceType, version constants, operator mapping
|
|
521
528
|
│ ├── connections.py # ConnectionConfig, VastbaseConnection (with version cache)
|
|
522
529
|
│ ├── exceptions.py # 19 exception classes
|
|
523
|
-
│ ├── mutation_result.py # MutationResult
|
|
530
|
+
│ ├── mutation_result.py # MutationResult (incl. MutationResultWrapper deprecated alias)
|
|
524
531
|
│ └── schema.py # FieldSchema, CollectionSchema, DataType
|
|
525
532
|
├── collection.py # Collection class with full CRUD, search, index ops
|
|
526
533
|
├── utility.py # 50+ utility functions: user/DB/privilege, flush/compact, 3.0.9+
|
|
@@ -531,7 +538,7 @@ pyvastbase/
|
|
|
531
538
|
├── utils/ # SQL generation, vector/distance/filter/result utilities
|
|
532
539
|
├── orm/ # Entity/Model ORM layer (Django-style decorators)
|
|
533
540
|
├── async_impl/ # AsyncCollection, async counterparts
|
|
534
|
-
├── tests/ #
|
|
541
|
+
├── tests/ # 1700+ tests (unit + integration)
|
|
535
542
|
└── docs/
|
|
536
543
|
└── api-reference.md # Full API reference in PyMilvus format
|
|
537
544
|
```
|
|
@@ -539,8 +546,8 @@ pyvastbase/
|
|
|
539
546
|
## Requirements
|
|
540
547
|
|
|
541
548
|
- Python >= 3.9
|
|
542
|
-
- psycopg[binary] >= 3.
|
|
543
|
-
- Vastbase
|
|
549
|
+
- psycopg[binary] >= 3.2
|
|
550
|
+
- Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2 (3.0.9+ for new vector types and features)
|
|
544
551
|
|
|
545
552
|
## License
|
|
546
553
|
|