graphiti-core 0.20.2__py3-none-any.whl → 0.20.4__py3-none-any.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.
Potentially problematic release.
This version of graphiti-core might be problematic. Click here for more details.
- graphiti_core/graphiti.py +29 -4
- {graphiti_core-0.20.2.dist-info → graphiti_core-0.20.4.dist-info}/METADATA +1 -1
- {graphiti_core-0.20.2.dist-info → graphiti_core-0.20.4.dist-info}/RECORD +5 -5
- {graphiti_core-0.20.2.dist-info → graphiti_core-0.20.4.dist-info}/WHEEL +0 -0
- {graphiti_core-0.20.2.dist-info → graphiti_core-0.20.4.dist-info}/licenses/LICENSE +0 -0
graphiti_core/graphiti.py
CHANGED
|
@@ -113,6 +113,20 @@ class AddEpisodeResults(BaseModel):
|
|
|
113
113
|
community_edges: list[CommunityEdge]
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
class AddBulkEpisodeResults(BaseModel):
|
|
117
|
+
episodes: list[EpisodicNode]
|
|
118
|
+
episodic_edges: list[EpisodicEdge]
|
|
119
|
+
nodes: list[EntityNode]
|
|
120
|
+
edges: list[EntityEdge]
|
|
121
|
+
communities: list[CommunityNode]
|
|
122
|
+
community_edges: list[CommunityEdge]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class AddTripletResults(BaseModel):
|
|
126
|
+
nodes: list[EntityNode]
|
|
127
|
+
edges: list[EntityEdge]
|
|
128
|
+
|
|
129
|
+
|
|
116
130
|
class Graphiti:
|
|
117
131
|
def __init__(
|
|
118
132
|
self,
|
|
@@ -572,7 +586,6 @@ class Graphiti:
|
|
|
572
586
|
except Exception as e:
|
|
573
587
|
raise e
|
|
574
588
|
|
|
575
|
-
##### EXPERIMENTAL #####
|
|
576
589
|
async def add_episode_bulk(
|
|
577
590
|
self,
|
|
578
591
|
bulk_episodes: list[RawEpisode],
|
|
@@ -581,7 +594,7 @@ class Graphiti:
|
|
|
581
594
|
excluded_entity_types: list[str] | None = None,
|
|
582
595
|
edge_types: dict[str, type[BaseModel]] | None = None,
|
|
583
596
|
edge_type_map: dict[tuple[str, str], list[str]] | None = None,
|
|
584
|
-
):
|
|
597
|
+
) -> AddBulkEpisodeResults:
|
|
585
598
|
"""
|
|
586
599
|
Process multiple episodes in bulk and update the graph.
|
|
587
600
|
|
|
@@ -597,7 +610,7 @@ class Graphiti:
|
|
|
597
610
|
|
|
598
611
|
Returns
|
|
599
612
|
-------
|
|
600
|
-
|
|
613
|
+
AddBulkEpisodeResults
|
|
601
614
|
|
|
602
615
|
Notes
|
|
603
616
|
-----
|
|
@@ -849,6 +862,15 @@ class Graphiti:
|
|
|
849
862
|
end = time()
|
|
850
863
|
logger.info(f'Completed add_episode_bulk in {(end - start) * 1000} ms')
|
|
851
864
|
|
|
865
|
+
return AddBulkEpisodeResults(
|
|
866
|
+
episodes=episodes,
|
|
867
|
+
episodic_edges=resolved_episodic_edges,
|
|
868
|
+
nodes=final_hydrated_nodes,
|
|
869
|
+
edges=resolved_edges + invalidated_edges,
|
|
870
|
+
communities=[],
|
|
871
|
+
community_edges=[],
|
|
872
|
+
)
|
|
873
|
+
|
|
852
874
|
except Exception as e:
|
|
853
875
|
raise e
|
|
854
876
|
|
|
@@ -998,7 +1020,9 @@ class Graphiti:
|
|
|
998
1020
|
|
|
999
1021
|
return SearchResults(edges=edges, nodes=nodes)
|
|
1000
1022
|
|
|
1001
|
-
async def add_triplet(
|
|
1023
|
+
async def add_triplet(
|
|
1024
|
+
self, source_node: EntityNode, edge: EntityEdge, target_node: EntityNode
|
|
1025
|
+
) -> AddTripletResults:
|
|
1002
1026
|
if source_node.name_embedding is None:
|
|
1003
1027
|
await source_node.generate_name_embedding(self.embedder)
|
|
1004
1028
|
if target_node.name_embedding is None:
|
|
@@ -1042,6 +1066,7 @@ class Graphiti:
|
|
|
1042
1066
|
await create_entity_node_embeddings(self.embedder, nodes)
|
|
1043
1067
|
|
|
1044
1068
|
await add_nodes_and_edges_bulk(self.driver, [], [], nodes, edges, self.embedder)
|
|
1069
|
+
return AddTripletResults(edges=edges, nodes=nodes)
|
|
1045
1070
|
|
|
1046
1071
|
async def remove_episode(self, episode_uuid: str):
|
|
1047
1072
|
# Find the episode to be deleted
|
|
@@ -2,7 +2,7 @@ graphiti_core/__init__.py,sha256=e5SWFkRiaUwfprYIeIgVIh7JDedNiloZvd3roU-0aDY,55
|
|
|
2
2
|
graphiti_core/edges.py,sha256=O-WqtqR9w6ZO5nbi4VRveXVrinfTcZmDJ6PcjudDAsY,18821
|
|
3
3
|
graphiti_core/errors.py,sha256=cH_v9TPgEPeQE6GFOHIg5TvejpUCBddGarMY2Whxbwc,2707
|
|
4
4
|
graphiti_core/graph_queries.py,sha256=9DWMiFTB-OmodMDaOws0lwzgiD7EUDNO7mAFJ1nxusE,6624
|
|
5
|
-
graphiti_core/graphiti.py,sha256=
|
|
5
|
+
graphiti_core/graphiti.py,sha256=eSQyajym9kefrf6PDCxCDzjWaco4hgFryyosg27husA,41601
|
|
6
6
|
graphiti_core/graphiti_types.py,sha256=C_p2XwScQlCzo7ets097TrSLs9ATxPZQ4WCsxDS7QHc,1066
|
|
7
7
|
graphiti_core/helpers.py,sha256=6q_wpiOW3_j28EfZ7FgWW7Hl5pONj_5zvVXZGW9FxTU,5175
|
|
8
8
|
graphiti_core/nodes.py,sha256=sJGCaEWroCL7rL7rUPqFw_NjTY-aNdc44fFOsvKZpdw,26399
|
|
@@ -74,7 +74,7 @@ graphiti_core/utils/maintenance/node_operations.py,sha256=r9ilkA01eq1z-nF8P_s1EX
|
|
|
74
74
|
graphiti_core/utils/maintenance/temporal_operations.py,sha256=IIaVtShpVkOYe6haxz3a1x3v54-MzaEXG8VsxFUNeoY,3582
|
|
75
75
|
graphiti_core/utils/maintenance/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
graphiti_core/utils/ontology_utils/entity_types_utils.py,sha256=4eVgxLWY6Q8k9cRJ5pW59IYF--U4nXZsZIGOVb_yHfQ,1285
|
|
77
|
-
graphiti_core-0.20.
|
|
78
|
-
graphiti_core-0.20.
|
|
79
|
-
graphiti_core-0.20.
|
|
80
|
-
graphiti_core-0.20.
|
|
77
|
+
graphiti_core-0.20.4.dist-info/METADATA,sha256=2lAkky1kK3GCk-H_BH3j-QZkqRobR5Gb0rFTKbbaQ4E,26773
|
|
78
|
+
graphiti_core-0.20.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
79
|
+
graphiti_core-0.20.4.dist-info/licenses/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
|
|
80
|
+
graphiti_core-0.20.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|