cocoindex 0.1.49__cp311-cp311-win_amd64.whl → 0.1.51__cp311-cp311-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.
@@ -0,0 +1,28 @@
1
+ cocoindex-0.1.51.dist-info/METADATA,sha256=VWHNukHF17O5re8ldifAS_BV1WTtfh4Iv8HDP_6ADIo,10040
2
+ cocoindex-0.1.51.dist-info/WHEEL,sha256=s0dDfj2AxxVsNT4qxjje5WVH9nG_gFfyCM_ZRxv6bRM,96
3
+ cocoindex-0.1.51.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.1.51.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
5
+ cocoindex/__init__.py,sha256=1-ymMFyNmEMpYyWfpOTsh84C4pYnNVeVHfrzusaINdk,1766
6
+ cocoindex/_engine.cp311-win_amd64.pyd,sha256=WgB6S1gMamwNSXL3u47mdtuAjt0r9Urtq42WbDMBmQw,61372928
7
+ cocoindex/auth_registry.py,sha256=LojDKoX0ccO-G3bboFMlAti50_t5GK9BS0ouPJZfyUs,745
8
+ cocoindex/cli.py,sha256=Sp_Hq3hyLU1JtQNHwlKEhReoGqNjJoAWhIGt_Q9kZDk,18800
9
+ cocoindex/convert.py,sha256=3OInFkmwi8RxdyAJsCLEdMa8tmmnX0Q1I0JFsInXDLo,9037
10
+ cocoindex/flow.py,sha256=ElTNrp9cxUZiKSvLMRwjU9rNQUn2d9zxryJzCxCFx4I,30985
11
+ cocoindex/functions.py,sha256=3l7POrvuk5DVIwGUgCODAi-JNFJ1_WLTOg6Yn-uZ0IE,2471
12
+ cocoindex/index.py,sha256=GrqTm1rLwICQ8hadtNvJAxVg7GWMvtMmFcbiNtNzmP0,569
13
+ cocoindex/lib.py,sha256=o2UGq3eWsZbK5nusZEU7Y0R6NTbT0i03G2ye8N6ATNg,3015
14
+ cocoindex/llm.py,sha256=sI46pXpTmOLOBOBpqCB2pnwDHz4PdVyEPBKZuIxObpU,372
15
+ cocoindex/op.py,sha256=qSf2-zGd77YVXDC8UWUyAtDIHklNrRaFn1ZvLK5T64g,12148
16
+ cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ cocoindex/runtime.py,sha256=saKEZntVwUVQNASRhiO9bHRVIFmQccemq2f9mo4mo1A,1090
18
+ cocoindex/setting.py,sha256=dRNdX-rPBn321zGx6GGoSMggS4F2879A6EBLOUbX8R4,3717
19
+ cocoindex/setup.py,sha256=nqJAEGQH-5yTulEy3aCAa9khbuiaqD81ZZUdeM3K_lo,799
20
+ cocoindex/sources.py,sha256=4hxsntuyClp_jKH4oZbx3iE3UM4P2bZTpWy28dqdyFY,1375
21
+ cocoindex/storages.py,sha256=WrfpGcOImFXH0DTEdBPRmL4GwyO62lfANMd6rTejxuQ,2939
22
+ cocoindex/tests/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
23
+ cocoindex/tests/test_convert.py,sha256=tIOFqF2LzHvW7v5Ny-JWAUhzvpskDOedHKmOTrQpEUw,29774
24
+ cocoindex/tests/test_optional_database.py,sha256=dnzmTgaJf37D3q8fQsjP5UDER6FYETaUokDnFBMLtIk,8755
25
+ cocoindex/tests/test_typing.py,sha256=9Fc_GALPinF9PdVlaO1_fFLi12dc7cNaV8XJma0f-2s,12818
26
+ cocoindex/typing.py,sha256=geA2nOq_frf9NGB_XpNDOHTviAitRbgYH5OWQ59VOgQ,12780
27
+ cocoindex/utils.py,sha256=RLyawj_M4ZDL-gwJ16e5p2AcFYIL50DlMkfZyKaNB2o,520
28
+ cocoindex-0.1.51.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.8.6)
2
+ Generator: maturin (1.8.7)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-win_amd64
cocoindex/query.py DELETED
@@ -1,115 +0,0 @@
1
- from typing import Callable, Any
2
- from dataclasses import dataclass
3
- from threading import Lock
4
-
5
- from . import flow as fl
6
- from . import index
7
- from . import _engine # type: ignore
8
-
9
- _handlers_lock = Lock()
10
- _handlers: dict[str, _engine.SimpleSemanticsQueryHandler] = {}
11
-
12
-
13
- @dataclass
14
- class SimpleSemanticsQueryInfo:
15
- """
16
- Additional information about the query.
17
- """
18
-
19
- similarity_metric: index.VectorSimilarityMetric
20
- query_vector: list[float]
21
- vector_field_name: str
22
-
23
-
24
- @dataclass
25
- class QueryResult:
26
- """
27
- A single result from the query.
28
- """
29
-
30
- data: dict[str, Any]
31
- score: float
32
-
33
-
34
- class SimpleSemanticsQueryHandler:
35
- """
36
- A query handler that uses simple semantics to query the index.
37
- """
38
-
39
- _lazy_query_handler: Callable[[], _engine.SimpleSemanticsQueryHandler]
40
-
41
- def __init__(
42
- self,
43
- name: str,
44
- flow: fl.Flow,
45
- target_name: str,
46
- query_transform_flow: Callable[..., fl.DataSlice[Any]],
47
- default_similarity_metric: index.VectorSimilarityMetric = index.VectorSimilarityMetric.COSINE_SIMILARITY,
48
- ) -> None:
49
- engine_handler = None
50
- lock = Lock()
51
-
52
- def _lazy_handler() -> _engine.SimpleSemanticsQueryHandler:
53
- nonlocal engine_handler, lock
54
- if engine_handler is None:
55
- with lock:
56
- if engine_handler is None:
57
- engine_handler = _engine.SimpleSemanticsQueryHandler(
58
- flow.internal_flow(),
59
- target_name,
60
- fl.TransformFlow(
61
- query_transform_flow, [str]
62
- ).internal_flow(),
63
- default_similarity_metric.value,
64
- )
65
- engine_handler.register_query_handler(name)
66
- return engine_handler
67
-
68
- self._lazy_query_handler = _lazy_handler
69
-
70
- with _handlers_lock:
71
- _handlers[name] = self
72
-
73
- def internal_handler(self) -> _engine.SimpleSemanticsQueryHandler:
74
- """
75
- Get the internal query handler.
76
- """
77
- return self._lazy_query_handler()
78
-
79
- def search(
80
- self,
81
- query: str,
82
- limit: int,
83
- vector_field_name: str | None = None,
84
- similarity_metric: index.VectorSimilarityMetric | None = None,
85
- ) -> tuple[list[QueryResult], SimpleSemanticsQueryInfo]:
86
- """
87
- Search the index with the given query, limit, vector field name, and similarity metric.
88
- """
89
- internal_results, internal_info = self.internal_handler().search(
90
- query,
91
- limit,
92
- vector_field_name,
93
- similarity_metric.value if similarity_metric is not None else None,
94
- )
95
- results = [
96
- QueryResult(data=result["data"], score=result["score"])
97
- for result in internal_results
98
- ]
99
- info = SimpleSemanticsQueryInfo(
100
- similarity_metric=index.VectorSimilarityMetric(
101
- internal_info["similarity_metric"]
102
- ),
103
- query_vector=internal_info["query_vector"],
104
- vector_field_name=internal_info["vector_field_name"],
105
- )
106
- return results, info
107
-
108
-
109
- def ensure_all_handlers_built() -> None:
110
- """
111
- Ensure all handlers are built.
112
- """
113
- with _handlers_lock:
114
- for handler in _handlers.values():
115
- handler.internal_handler()
@@ -1,27 +0,0 @@
1
- cocoindex-0.1.49.dist-info/METADATA,sha256=s1ZnlhLjOHMMNUyZGTdr7vQG55ffcZpBqihwwA-bvS0,10040
2
- cocoindex-0.1.49.dist-info/WHEEL,sha256=Kw8y023UaufEXFM028WbBCk7rJUUAhAX1Zw-54pv0m4,96
3
- cocoindex-0.1.49.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
- cocoindex-0.1.49.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
5
- cocoindex/__init__.py,sha256=M_Iy0BCuceR537ZLz4dunGq8KYT060LF0N48sDnyIwM,835
6
- cocoindex/_engine.cp311-win_amd64.pyd,sha256=ix86g-p5FQbC1AYZec2OnZnOFkrohZA1LQIb_FjB1dY,61482496
7
- cocoindex/auth_registry.py,sha256=LojDKoX0ccO-G3bboFMlAti50_t5GK9BS0ouPJZfyUs,745
8
- cocoindex/cli.py,sha256=zhSK6eDLn2UlKWrVTg2xZ89S-xB1XEH4pYWcz1xGS-Y,18411
9
- cocoindex/convert.py,sha256=Jc9hKaudlN4rOgXyXNs5O965xBqm7SURvjzpuVrutrY,7528
10
- cocoindex/flow.py,sha256=ElTNrp9cxUZiKSvLMRwjU9rNQUn2d9zxryJzCxCFx4I,30985
11
- cocoindex/functions.py,sha256=iJWfznAFu3COgA5027JNL-d-yNL4G3opdzbzBGOj7CM,2370
12
- cocoindex/index.py,sha256=GrqTm1rLwICQ8hadtNvJAxVg7GWMvtMmFcbiNtNzmP0,569
13
- cocoindex/lib.py,sha256=NsAhzFeAbBNWBZqDe9oUsjHa2IV0LSvq8CGqSbS0C1Q,3061
14
- cocoindex/llm.py,sha256=sI46pXpTmOLOBOBpqCB2pnwDHz4PdVyEPBKZuIxObpU,372
15
- cocoindex/op.py,sha256=qSf2-zGd77YVXDC8UWUyAtDIHklNrRaFn1ZvLK5T64g,12148
16
- cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- cocoindex/query.py,sha256=sJebMErxa16PrRAbp4YN9BtNNYfX4s_AXXuNRU127IQ,3565
18
- cocoindex/runtime.py,sha256=saKEZntVwUVQNASRhiO9bHRVIFmQccemq2f9mo4mo1A,1090
19
- cocoindex/setting.py,sha256=AY4oAUgUXqUWshhrOHZUY0sdprfOQDmRTLewyMcoJhQ,3541
20
- cocoindex/setup.py,sha256=nqJAEGQH-5yTulEy3aCAa9khbuiaqD81ZZUdeM3K_lo,799
21
- cocoindex/sources.py,sha256=4hxsntuyClp_jKH4oZbx3iE3UM4P2bZTpWy28dqdyFY,1375
22
- cocoindex/storages.py,sha256=WrfpGcOImFXH0DTEdBPRmL4GwyO62lfANMd6rTejxuQ,2939
23
- cocoindex/tests/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
24
- cocoindex/tests/test_convert.py,sha256=-8DI7B2nKneeBVLzovAhngbMjHi9vYJ1TCixl-XosYQ,17634
25
- cocoindex/typing.py,sha256=_Hj79DiYZ5LOkkPqu-uScup9Qy_035fb2QOVNL-44KY,9780
26
- cocoindex/utils.py,sha256=RLyawj_M4ZDL-gwJ16e5p2AcFYIL50DlMkfZyKaNB2o,520
27
- cocoindex-0.1.49.dist-info/RECORD,,