cocoindex 0.1.22__cp312-cp312-manylinux_2_28_aarch64.whl → 0.1.23__cp312-cp312-manylinux_2_28_aarch64.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/_engine.cpython-312-aarch64-linux-gnu.so +0 -0
- cocoindex/functions.py +3 -0
- cocoindex/storages.py +10 -10
- cocoindex/typing.py +1 -5
- {cocoindex-0.1.22.dist-info → cocoindex-0.1.23.dist-info}/METADATA +1 -1
- {cocoindex-0.1.22.dist-info → cocoindex-0.1.23.dist-info}/RECORD +8 -8
- {cocoindex-0.1.22.dist-info → cocoindex-0.1.23.dist-info}/WHEEL +0 -0
- {cocoindex-0.1.22.dist-info → cocoindex-0.1.23.dist-info}/licenses/LICENSE +0 -0
Binary file
|
cocoindex/functions.py
CHANGED
@@ -5,6 +5,9 @@ import sentence_transformers
|
|
5
5
|
from .typing import Float32, Vector, TypeAttr
|
6
6
|
from . import op, llm
|
7
7
|
|
8
|
+
class ParseJson(op.FunctionSpec):
|
9
|
+
"""Parse a text into a JSON object."""
|
10
|
+
|
8
11
|
class SplitRecursively(op.FunctionSpec):
|
9
12
|
"""Split a document (in string) recursively."""
|
10
13
|
|
cocoindex/storages.py
CHANGED
@@ -29,7 +29,7 @@ class Neo4jConnection:
|
|
29
29
|
db: str | None = None
|
30
30
|
|
31
31
|
@dataclass
|
32
|
-
class
|
32
|
+
class GraphFieldMapping:
|
33
33
|
"""Mapping for a Neo4j field."""
|
34
34
|
field_name: str
|
35
35
|
# Field name for the node in the Knowledge Graph.
|
@@ -37,36 +37,36 @@ class Neo4jFieldMapping:
|
|
37
37
|
node_field_name: str | None = None
|
38
38
|
|
39
39
|
@dataclass
|
40
|
-
class
|
40
|
+
class GraphRelationshipEnd:
|
41
41
|
"""Spec for a Neo4j node type."""
|
42
42
|
label: str
|
43
|
-
fields: list[
|
43
|
+
fields: list[GraphFieldMapping]
|
44
44
|
|
45
45
|
@dataclass
|
46
|
-
class
|
46
|
+
class GraphRelationshipNode:
|
47
47
|
"""Spec for a Neo4j node type."""
|
48
48
|
primary_key_fields: Sequence[str]
|
49
49
|
vector_indexes: Sequence[index.VectorIndexDef] = ()
|
50
50
|
|
51
51
|
@dataclass
|
52
|
-
class
|
52
|
+
class GraphNode:
|
53
53
|
"""Spec for a Neo4j node type."""
|
54
54
|
kind = "Node"
|
55
55
|
|
56
56
|
label: str
|
57
57
|
|
58
58
|
@dataclass
|
59
|
-
class
|
59
|
+
class GraphRelationship:
|
60
60
|
"""Spec for a Neo4j relationship."""
|
61
61
|
kind = "Relationship"
|
62
62
|
|
63
63
|
rel_type: str
|
64
|
-
source:
|
65
|
-
target:
|
66
|
-
nodes: dict[str,
|
64
|
+
source: GraphRelationshipEnd
|
65
|
+
target: GraphRelationshipEnd
|
66
|
+
nodes: dict[str, GraphRelationshipNode] | None = None
|
67
67
|
|
68
68
|
class Neo4j(op.StorageSpec):
|
69
69
|
"""Graph storage powered by Neo4j."""
|
70
70
|
|
71
71
|
connection: AuthEntryReference
|
72
|
-
mapping:
|
72
|
+
mapping: GraphNode | GraphRelationship
|
cocoindex/typing.py
CHANGED
@@ -183,11 +183,7 @@ def _encode_type(type_info: AnalyzedTypeInfo) -> dict[str, Any]:
|
|
183
183
|
if type_info.elem_type is None:
|
184
184
|
raise ValueError(f"{type_info.kind} type must have an element type")
|
185
185
|
row_type_info = analyze_type_info(type_info.elem_type)
|
186
|
-
|
187
|
-
raise ValueError(f"{type_info.kind} type must have a dataclass type")
|
188
|
-
encoded_type['row'] = {
|
189
|
-
'fields': _encode_fields_schema(row_type_info.dataclass_type),
|
190
|
-
}
|
186
|
+
encoded_type['row'] = _encode_type(row_type_info)
|
191
187
|
|
192
188
|
return encoded_type
|
193
189
|
|
@@ -1,12 +1,12 @@
|
|
1
|
-
cocoindex-0.1.
|
2
|
-
cocoindex-0.1.
|
3
|
-
cocoindex-0.1.
|
1
|
+
cocoindex-0.1.23.dist-info/METADATA,sha256=IcyNWcJi0ycAqXknL1KbV-tsNRQqNf3a097Xrpbe4g8,8066
|
2
|
+
cocoindex-0.1.23.dist-info/WHEEL,sha256=xOZEB-WIKOrrrITqsx8xpY2EDgJkCu53Yhd8N6qLrYE,109
|
3
|
+
cocoindex-0.1.23.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
4
4
|
cocoindex/llm.py,sha256=uHXub9AWTOtxNyTaefHY-VuY_yzo6ikM1kUxHsQn-zw,298
|
5
5
|
cocoindex/tests/test_convert.py,sha256=wSAiskmBgBM5UZussbNXmCxt47hHGlSEEQVgDZaY4TE,2058
|
6
6
|
cocoindex/tests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
7
7
|
cocoindex/sources.py,sha256=wZFU8lwSXjyofJR-syySH9fTyPnBlAPJ6-1hQNX8fGA,936
|
8
|
-
cocoindex/typing.py,sha256=
|
9
|
-
cocoindex/storages.py,sha256=
|
8
|
+
cocoindex/typing.py,sha256=4mP9VXS75s3VMfF1LDc1LXsBng7uGdR5aD73N8iaeSM,7282
|
9
|
+
cocoindex/storages.py,sha256=ZWpQABuUWTs6BdPcTBWDOiRXVGxS87Uh2i_C1wtkXYQ,1718
|
10
10
|
cocoindex/flow.py,sha256=HwngOKZyF60pUE_LGjt02yVNWh-haoMWH1Si0w5rYqY,19856
|
11
11
|
cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
cocoindex/setup.py,sha256=W1HshwYk_K2aeLOVn_e62ZOXBO9yWsoUboRiH4SjF48,496
|
@@ -16,8 +16,8 @@ cocoindex/op.py,sha256=UaBgkWN8KEKqD-3UEYW_v-99OwNQZfIB4PdpAd4jd74,9984
|
|
16
16
|
cocoindex/__init__.py,sha256=f4LTPg4db7Wm3QO9HirvhsT11OVykiFxGbt1JK6taFA,572
|
17
17
|
cocoindex/cli.py,sha256=jRwGCPuqkBz_cIp7LKARCRAiDsPm91bsduKzfYJohJ4,6931
|
18
18
|
cocoindex/lib.py,sha256=kyfzkaanrMHVwWjd2UWgLr8ArS_vjlK64qb4TbNTbbs,3464
|
19
|
-
cocoindex/functions.py,sha256=
|
19
|
+
cocoindex/functions.py,sha256=xcAeRQTy9JObfxpjyMn-dPY2y7XhVWjB7759xVyup6o,1657
|
20
20
|
cocoindex/auth_registry.py,sha256=lZ2rD5_9aC_UpGk7t4TmSYal_rjN7eHgO4_sU7FR0Zw,620
|
21
21
|
cocoindex/index.py,sha256=LssEOuZi6AqhwKtZM3QFeQpa9T-0ELi8G5DsrYKECvc,534
|
22
|
-
cocoindex/_engine.cpython-312-aarch64-linux-gnu.so,sha256=
|
23
|
-
cocoindex-0.1.
|
22
|
+
cocoindex/_engine.cpython-312-aarch64-linux-gnu.so,sha256=VfLg3LJ2C_ARY8XmYKW7LXN_4YDI-gGolWNFf6ZQ5Ok,63385472
|
23
|
+
cocoindex-0.1.23.dist-info/RECORD,,
|
File without changes
|
File without changes
|