cocoindex 0.2.12__cp311-abi3-manylinux_2_28_x86_64.whl → 0.2.14__cp311-abi3-manylinux_2_28_x86_64.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 +9 -1
- cocoindex/_engine.abi3.so +0 -0
- cocoindex/index.py +22 -1
- cocoindex/query_handler.py +8 -2
- cocoindex/targets/lancedb.py +6 -0
- {cocoindex-0.2.12.dist-info → cocoindex-0.2.14.dist-info}/METADATA +3 -1
- {cocoindex-0.2.12.dist-info → cocoindex-0.2.14.dist-info}/RECORD +10 -10
- {cocoindex-0.2.12.dist-info → cocoindex-0.2.14.dist-info}/licenses/THIRD_PARTY_NOTICES.html +27 -33
- {cocoindex-0.2.12.dist-info → cocoindex-0.2.14.dist-info}/WHEEL +0 -0
- {cocoindex-0.2.12.dist-info → cocoindex-0.2.14.dist-info}/entry_points.txt +0 -0
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
|
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.abi3.so
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
|
cocoindex/query_handler.py
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
import dataclasses
|
2
2
|
import numpy as np
|
3
3
|
from numpy import typing as npt
|
4
|
-
from typing import Generic,
|
4
|
+
from typing import Generic, Any
|
5
5
|
from .index import VectorSimilarityMetric
|
6
|
+
import sys
|
7
|
+
|
8
|
+
if sys.version_info >= (3, 13):
|
9
|
+
from typing import TypeVar
|
10
|
+
else:
|
11
|
+
from typing_extensions import TypeVar # PEP 696 backport
|
6
12
|
|
7
13
|
|
8
14
|
@dataclasses.dataclass
|
@@ -35,7 +41,7 @@ class QueryInfo:
|
|
35
41
|
similarity_metric: VectorSimilarityMetric | None = None
|
36
42
|
|
37
43
|
|
38
|
-
R = TypeVar("R")
|
44
|
+
R = TypeVar("R", default=Any)
|
39
45
|
|
40
46
|
|
41
47
|
@dataclasses.dataclass
|
cocoindex/targets/lancedb.py
CHANGED
@@ -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.
|
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
|
@@ -16,6 +16,7 @@ Classifier: Topic :: Text Processing :: Indexing
|
|
16
16
|
Classifier: Intended Audience :: Developers
|
17
17
|
Classifier: Natural Language :: English
|
18
18
|
Classifier: Typing :: Typed
|
19
|
+
Requires-Dist: typing-extensions>=4.12 ; python_full_version < '3.13'
|
19
20
|
Requires-Dist: click>=8.1.8
|
20
21
|
Requires-Dist: rich>=14.0.0
|
21
22
|
Requires-Dist: python-dotenv>=1.1.0
|
@@ -230,6 +231,7 @@ It defines an index flow like this:
|
|
230
231
|
| [Google Drive Text Embedding](examples/gdrive_text_embedding) | Index text documents from Google Drive |
|
231
232
|
| [Docs to Knowledge Graph](examples/docs_to_knowledge_graph) | Extract relationships from Markdown documents and build a knowledge graph |
|
232
233
|
| [Embeddings to Qdrant](examples/text_embedding_qdrant) | Index documents in a Qdrant collection for semantic search |
|
234
|
+
| [Embeddings to LanceDB](examples/text_embedding_lancedb) | Index documents in a LanceDB collection for semantic search |
|
233
235
|
| [FastAPI Server with Docker](examples/fastapi_server_docker) | Run the semantic search server in a Dockerized FastAPI setup |
|
234
236
|
| [Product Recommendation](examples/product_recommendation) | Build real-time product recommendations with LLM and graph database|
|
235
237
|
| [Image Search with Vision API](examples/image_search) | Generates detailed captions for images using a vision model, embeds them, enables live-updating semantic search via FastAPI and served on a React frontend|
|
@@ -1,20 +1,20 @@
|
|
1
|
-
cocoindex-0.2.
|
2
|
-
cocoindex-0.2.
|
3
|
-
cocoindex-0.2.
|
4
|
-
cocoindex-0.2.
|
5
|
-
cocoindex/__init__.py,sha256=
|
6
|
-
cocoindex/_engine.abi3.so,sha256=
|
1
|
+
cocoindex-0.2.14.dist-info/METADATA,sha256=rohqn4_9s8I4l6dxYLSTqdphN-fogyzjZNFU65w_ZiE,13316
|
2
|
+
cocoindex-0.2.14.dist-info/WHEEL,sha256=IG-K_sumA04dNIpy5J1b3kZo_HELEjvxxDWHD32zTgo,107
|
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=DP7l1Z05oxOiBl-PmLhqs3Lh2HcGg589DrSv4KCEvio,2563
|
6
|
+
cocoindex/_engine.abi3.so,sha256=8_CUvr9MtBRWyow-Zp0n0e2OUUEf3W9DMIEV0c98HPQ,73509920
|
7
7
|
cocoindex/auth_registry.py,sha256=_DOIY42C79joLCY_XczHwP5uebkmSavweoAHc0L3hQY,1334
|
8
8
|
cocoindex/cli.py,sha256=69X30bFTFdM7c0_6lgIHR19CeQ7UEkobEQYihy8IdOQ,21599
|
9
9
|
cocoindex/convert.py,sha256=itkUBCriOk8fdauahHRqJ-L8mnHehNZsBe_FouN0K1Q,28695
|
10
10
|
cocoindex/flow.py,sha256=Vk72dX_svfpinvsolQ11aw6YDqbzaafrAi7xrQHo1i0,39844
|
11
11
|
cocoindex/functions.py,sha256=09erNt3WbzY9l1KER-akBF2O5-6xEahV2ORBECaL6yk,12260
|
12
|
-
cocoindex/index.py,sha256=
|
12
|
+
cocoindex/index.py,sha256=tz5ilvmOp0BtroGehCQDqWK_pIX9m6ghkhcxsDVU8WE,982
|
13
13
|
cocoindex/lib.py,sha256=0XheDF7fiFdqExpdqzU-VKun_Zll6DwZ5JfTm7u42aY,2284
|
14
14
|
cocoindex/llm.py,sha256=Pv_cdnRngTLtuLU9AUmS8izIHhcKVnuBNolC33f9BDI,851
|
15
15
|
cocoindex/op.py,sha256=c1xzoiWoPb6PYiCQAUsyzMRJwPvWaC3o5emPk38oY-4,26551
|
16
16
|
cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
-
cocoindex/query_handler.py,sha256=
|
17
|
+
cocoindex/query_handler.py,sha256=X-SQT71LHiOOXn6-TJlQcGodJk-iT8p_1TcIMvRLBRI,1344
|
18
18
|
cocoindex/runtime.py,sha256=4NxcltaDZvA3RR3Pnt6gH_f99jcWSyMH_1Xi5BjbtwY,1342
|
19
19
|
cocoindex/setting.py,sha256=1Dx8ktjwf-8BiXrbsmfn5Mzudb2SQYqFdRnSNGVKaLk,4960
|
20
20
|
cocoindex/setup.py,sha256=7uIHKN4FOCuoidPXcKyGTrkqpkl9luL49-6UcnMxYzw,3068
|
@@ -22,7 +22,7 @@ cocoindex/sources.py,sha256=FYz7cWYasLGDaYoIEQ1dF2uprgUETHWsTIrIS7n6pQE,3188
|
|
22
22
|
cocoindex/subprocess_exec.py,sha256=r1xO84uek4VP4I6i87JMwsH5xFm3vKW0ABvgn0jskt4,10088
|
23
23
|
cocoindex/targets/__init__.py,sha256=HQG7I4U0xQhHiYctiUvwEBLxT2727oHP3xwrqotjmhk,78
|
24
24
|
cocoindex/targets/_engine_builtin_specs.py,sha256=DM7vyO0pkoukA-aBbvm_J4irgXhXIEqWdp-hwVpVRU4,2800
|
25
|
-
cocoindex/targets/lancedb.py,sha256=
|
25
|
+
cocoindex/targets/lancedb.py,sha256=1nzCre5p-fvKkmLOTvfpiLTfnhF3qMLqTvsTwNuGwVU,15749
|
26
26
|
cocoindex/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
cocoindex/tests/test_convert.py,sha256=pG1AkEdIKSRE0trMV2dQ6VSQEqQJnPTJzfQCVrZSz8w,50791
|
28
28
|
cocoindex/tests/test_load_convert.py,sha256=XHuXhgLcazniEYrhoz_L5RFvgUwu-iy3EB9zgR6p95A,3339
|
@@ -34,4 +34,4 @@ cocoindex/typing.py,sha256=jZO3meRVL_RsFdhj8Sx6gWF-Z207VhoPtb1ZmqzAnH0,19974
|
|
34
34
|
cocoindex/user_app_loader.py,sha256=bc3Af-gYRxJ9GpObtpjegZY855oQBCv5FGkrkWV2yGY,1873
|
35
35
|
cocoindex/utils.py,sha256=hUhX-XV6XGCtJSEIpBOuDv6VvqImwPlgBxztBTw7u0U,598
|
36
36
|
cocoindex/validation.py,sha256=PZnJoby4sLbsmPv9fOjOQXuefjfZ7gmtsiTGU8SH-tc,3090
|
37
|
-
cocoindex-0.2.
|
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.
|
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>
|
@@ -10673,38 +10673,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
10673
10673
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
10674
10674
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
10675
10675
|
THE SOFTWARE.</pre>
|
10676
|
-
</li>
|
10677
|
-
<li class="license">
|
10678
|
-
<h3 id="MIT">MIT License</h3>
|
10679
|
-
<h4>Used by:</h4>
|
10680
|
-
<ul class="license-used-by">
|
10681
|
-
<li><a href=" https://github.com/tree-sitter/tree-sitter-scala ">tree-sitter-scala 0.24.0</a></li>
|
10682
|
-
</ul>
|
10683
|
-
<pre class="license-text">(The MIT License)
|
10684
|
-
|
10685
|
-
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
10686
|
-
|
10687
|
-
Permission is hereby granted, free of charge, to any person
|
10688
|
-
obtaining a copy of this software and associated documentation
|
10689
|
-
files (the "Software"), to deal in the Software without
|
10690
|
-
restriction, including without limitation the rights to use,
|
10691
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10692
|
-
copies of the Software, and to permit persons to whom the
|
10693
|
-
Software is furnished to do so, subject to the following
|
10694
|
-
conditions:
|
10695
|
-
|
10696
|
-
The above copyright notice and this permission notice shall be
|
10697
|
-
included in all copies or substantial portions of the Software.
|
10698
|
-
|
10699
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
10700
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
10701
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
10702
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
10703
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
10704
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
10705
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
10706
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
10707
|
-
</pre>
|
10708
10676
|
</li>
|
10709
10677
|
<li class="license">
|
10710
10678
|
<h3 id="MIT">MIT License</h3>
|
@@ -12299,6 +12267,32 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
12299
12267
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
12300
12268
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
12301
12269
|
THE SOFTWARE.
|
12270
|
+
</pre>
|
12271
|
+
</li>
|
12272
|
+
<li class="license">
|
12273
|
+
<h3 id="MIT">MIT License</h3>
|
12274
|
+
<h4>Used by:</h4>
|
12275
|
+
<ul class="license-used-by">
|
12276
|
+
<li><a href=" https://github.com/tree-sitter/tree-sitter-scala ">tree-sitter-scala 0.24.0</a></li>
|
12277
|
+
</ul>
|
12278
|
+
<pre class="license-text">This software is released under the MIT license:
|
12279
|
+
|
12280
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
12281
|
+
this software and associated documentation files (the "Software"), to deal in
|
12282
|
+
the Software without restriction, including without limitation the rights to
|
12283
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
12284
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
12285
|
+
subject to the following conditions:
|
12286
|
+
|
12287
|
+
The above copyright notice and this permission notice shall be included in all
|
12288
|
+
copies or substantial portions of the Software.
|
12289
|
+
|
12290
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
12291
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
12292
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
12293
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
12294
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
12295
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
12302
12296
|
</pre>
|
12303
12297
|
</li>
|
12304
12298
|
<li class="license">
|
File without changes
|
File without changes
|