cocoindex 0.2.13__cp311-abi3-win_amd64.whl → 0.2.14__cp311-abi3-win_amd64.whl

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.
cocoindex/__init__.py CHANGED
@@ -21,7 +21,13 @@ from .flow import add_flow_def, remove_flow # DEPRECATED
21
21
  from .flow import update_all_flows_async, setup_all_flows, drop_all_flows
22
22
  from .lib import settings, init, start_server, stop
23
23
  from .llm import LlmSpec, LlmApiType
24
- from .index import VectorSimilarityMetric, VectorIndexDef, IndexOptions
24
+ from .index import (
25
+ VectorSimilarityMetric,
26
+ VectorIndexDef,
27
+ IndexOptions,
28
+ HnswVectorIndexMethod,
29
+ IvfFlatVectorIndexMethod,
30
+ )
25
31
  from .setting import DatabaseConnectionSpec, Settings, ServerSettings
26
32
  from .setting import get_app_namespace
27
33
  from .query_handler import QueryHandlerResultFields, QueryInfo, QueryOutput
@@ -82,6 +88,8 @@ __all__ = [
82
88
  "VectorSimilarityMetric",
83
89
  "VectorIndexDef",
84
90
  "IndexOptions",
91
+ "HnswVectorIndexMethod",
92
+ "IvfFlatVectorIndexMethod",
85
93
  # Settings
86
94
  "DatabaseConnectionSpec",
87
95
  "Settings",
cocoindex/_engine.pyd CHANGED
Binary file
cocoindex/index.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from enum import Enum
2
2
  from dataclasses import dataclass
3
- from typing import Sequence
3
+ from typing import Sequence, Union
4
4
 
5
5
 
6
6
  class VectorSimilarityMetric(Enum):
@@ -9,6 +9,26 @@ class VectorSimilarityMetric(Enum):
9
9
  INNER_PRODUCT = "InnerProduct"
10
10
 
11
11
 
12
+ @dataclass
13
+ class HnswVectorIndexMethod:
14
+ """HNSW vector index parameters."""
15
+
16
+ kind: str = "Hnsw"
17
+ m: int | None = None
18
+ ef_construction: int | None = None
19
+
20
+
21
+ @dataclass
22
+ class IvfFlatVectorIndexMethod:
23
+ """IVFFlat vector index parameters."""
24
+
25
+ kind: str = "IvfFlat"
26
+ lists: int | None = None
27
+
28
+
29
+ VectorIndexMethod = Union[HnswVectorIndexMethod, IvfFlatVectorIndexMethod]
30
+
31
+
12
32
  @dataclass
13
33
  class VectorIndexDef:
14
34
  """
@@ -17,6 +37,7 @@ class VectorIndexDef:
17
37
 
18
38
  field_name: str
19
39
  metric: VectorSimilarityMetric
40
+ method: VectorIndexMethod | None = None
20
41
 
21
42
 
22
43
  @dataclass
@@ -296,6 +296,12 @@ class _Connector:
296
296
  ) -> _State:
297
297
  if len(key_fields_schema) != 1:
298
298
  raise ValueError("LanceDB only supports a single key field")
299
+ if index_options.vector_indexes is not None:
300
+ for vector_index in index_options.vector_indexes:
301
+ if vector_index.method is not None:
302
+ raise ValueError(
303
+ "Vector index method is not configurable for LanceDB yet"
304
+ )
299
305
  return _State(
300
306
  key_field_schema=key_fields_schema[0],
301
307
  value_fields_schema=value_fields_schema,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.2.13
3
+ Version: 0.2.14
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: License :: OSI Approved :: Apache Software License
6
6
  Classifier: Operating System :: OS Independent
@@ -1,15 +1,15 @@
1
- cocoindex-0.2.13.dist-info/METADATA,sha256=vzhr0QNlNhDyCxOqEyRUtFbuAXgdIr1Ofh71szxbikI,13533
2
- cocoindex-0.2.13.dist-info/WHEEL,sha256=8hEf8NzM1FnmM77AjVt5h8nDuYkN3UqZ79LoIAHXeRE,95
3
- cocoindex-0.2.13.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
- cocoindex-0.2.13.dist-info/licenses/THIRD_PARTY_NOTICES.html,sha256=kOcN_-Ew74skSjMDUYvpRfdbB2pO24VPcbup3dwagb4,717769
5
- cocoindex/__init__.py,sha256=7FXm4Q_I_aLgVxY2nd5PTWQ6Z92mTjJ1B5WxTHpj6p8,2531
6
- cocoindex/_engine.pyd,sha256=sQRevUk3bCiiHXaWDpCWfIyMUh2hO5LPbw-I-MHxyB4,73074176
1
+ cocoindex-0.2.14.dist-info/METADATA,sha256=bWQFvttECaBKcQdYAFov7AmyB4yMjdxgQ7YX7TzPQj4,13533
2
+ cocoindex-0.2.14.dist-info/WHEEL,sha256=8hEf8NzM1FnmM77AjVt5h8nDuYkN3UqZ79LoIAHXeRE,95
3
+ cocoindex-0.2.14.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.2.14.dist-info/licenses/THIRD_PARTY_NOTICES.html,sha256=3Rq0MMyXp4exsfuop4rrPxu53e48XPYvzTfvV8EBY-Y,717769
5
+ cocoindex/__init__.py,sha256=oyYycktbuoJU_kv0El1EwU5TeRQmWTl8r_IYV169uTg,2674
6
+ cocoindex/_engine.pyd,sha256=i23K0h6-IM0gImIlwpuzBGYLWEp4Y-Dzl8_eSbFYE1w,73169920
7
7
  cocoindex/auth_registry.py,sha256=Rl2L3W9BHuJ5bZF2f1el-nRuhRpYz7_5F4gI7EF-jGI,1378
8
8
  cocoindex/cli.py,sha256=Wt8wUjWqHEBoR3gDnHqIplLaL_tbStMCHAOuYhYq84A,22338
9
9
  cocoindex/convert.py,sha256=sr4jvCkqn_L-Jo_O-GzinfhFD7eFvrd_DpqwPRA65Mc,29474
10
10
  cocoindex/flow.py,sha256=X1rm2LGJpUlVWW4bRSOpEkeM9G8wkYHkK4bp5jhI_O4,41118
11
11
  cocoindex/functions.py,sha256=CtiwTVW6g4BtO5_EvVcij7Si4Bx-axnM1hsdU43aM4g,12617
12
- cocoindex/index.py,sha256=GrqTm1rLwICQ8hadtNvJAxVg7GWMvtMmFcbiNtNzmP0,569
12
+ cocoindex/index.py,sha256=C__LzwIC918VIDGsBsyLwvNBO-4BiC5Coq01Fp1zXkI,1032
13
13
  cocoindex/lib.py,sha256=-Ys4a7BdDOW_ctz9vEBA5fSOqwsY_IKLHxaDwxvoXRg,2359
14
14
  cocoindex/llm.py,sha256=JM5EPup7FZojynCI0rg4gnMBYmdPZpaHJbVBz3f7BAI,897
15
15
  cocoindex/op.py,sha256=34PnWY2I5WRxN8S4IOLjV0QZZyVxK0yyYTAKHu64He8,27295
@@ -22,7 +22,7 @@ cocoindex/sources.py,sha256=Ij8LyYbM49zjPg-pJHMbas8sdLquEcgvmuYfv7wCdjI,3290
22
22
  cocoindex/subprocess_exec.py,sha256=u_kF4C8dToPg-9a7NeFroR8pJCOFag_NT0icLe184QQ,10391
23
23
  cocoindex/targets/__init__.py,sha256=6cO57jLhBloC1o-sBHG6OXfIgBdRQtz5RDi6FLqlQhU,83
24
24
  cocoindex/targets/_engine_builtin_specs.py,sha256=GJnKTP55A-GIMc2Z-Lhr_hE6vvsv6Iw-9cdz40qjAkU,2935
25
- cocoindex/targets/lancedb.py,sha256=lu9FFSq8sDXudyYxyoHfJ7AKSzaruA6zXUnIhgoBgnU,15900
25
+ cocoindex/targets/lancedb.py,sha256=RQZREffJMsO75W6SuvNnFBufMGEaJatHQa-f70dIUGc,16215
26
26
  cocoindex/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  cocoindex/tests/test_convert.py,sha256=Gk44bHNr639c8QzVY1ctCyL5PmnfvQwAi7dgM8Xujrk,52359
28
28
  cocoindex/tests/test_load_convert.py,sha256=WU7euC7bes3R_a4tcOkzRbdzb36Ef5JK1-2ZlFF_uWs,3457
@@ -34,4 +34,4 @@ cocoindex/typing.py,sha256=ezjTozTH64ehqYWp00JWOsP3D-ytEFD4UE5WKUUPkOU,20654
34
34
  cocoindex/user_app_loader.py,sha256=ZkvUG9aJNNECAjwTY0ZYtNpFd9dNBPVoPKGTtB7dSZg,1926
35
35
  cocoindex/utils.py,sha256=U3W39zD2uZpXX8v84tJD7sRmbC5ar3z_ljAP1cJrYXI,618
36
36
  cocoindex/validation.py,sha256=4ZjsW-SZT8X_TEEhEE6QG6D-8Oq_TkPAhTqP0mdFYSE,3194
37
- cocoindex-0.2.13.dist-info/RECORD,,
37
+ cocoindex-0.2.14.dist-info/RECORD,,
@@ -2428,7 +2428,7 @@ Software.
2428
2428
  <h3 id="Apache-2.0">Apache License 2.0</h3>
2429
2429
  <h4>Used by:</h4>
2430
2430
  <ul class="license-used-by">
2431
- <li><a href=" https://crates.io/crates/cocoindex ">cocoindex 0.2.13</a></li>
2431
+ <li><a href=" https://crates.io/crates/cocoindex ">cocoindex 0.2.14</a></li>
2432
2432
  <li><a href=" https://github.com/awesomized/crc-fast-rust ">crc-fast 1.3.0</a></li>
2433
2433
  <li><a href=" https://github.com/qdrant/rust-client ">qdrant-client 1.15.0</a></li>
2434
2434
  </ul>