diff --git a/graphiti_core/edges.py b/graphiti_core/edges.py index e2878391..8459842b 100644 --- a/graphiti_core/edges.py +++ b/graphiti_core/edges.py @@ -33,7 +33,7 @@ class Edge(BaseModel, ABC): - uuid: str = Field(default_factory=lambda: uuid4().hex) + uuid: str = Field(default_factory=lambda: str(uuid4())) group_id: str | None = Field(description='partition of the graph') source_node_uuid: str target_node_uuid: str diff --git a/graphiti_core/nodes.py b/graphiti_core/nodes.py index 06ed52c6..ccbbb33f 100644 --- a/graphiti_core/nodes.py +++ b/graphiti_core/nodes.py @@ -68,7 +68,7 @@ def from_str(episode_type: str): class Node(BaseModel, ABC): - uuid: str = Field(default_factory=lambda: uuid4().hex) + uuid: str = Field(default_factory=lambda: str(uuid4())) name: str = Field(description='name of the node') group_id: str | None = Field(description='partition of the graph') labels: list[str] = Field(default_factory=list) diff --git a/pyproject.toml b/pyproject.toml index 29c61f51..3e022a72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "graphiti-core" -version = "0.3.2" +version = "0.3.3" description = "A temporal graph building library" authors = [ "Paul Paliychuk ", diff --git a/server/graph_service/routers/ingest.py b/server/graph_service/routers/ingest.py index 58ff9f35..f1e2ab6c 100644 --- a/server/graph_service/routers/ingest.py +++ b/server/graph_service/routers/ingest.py @@ -55,6 +55,7 @@ async def add_messages( ): async def add_messages_task(m: Message): await graphiti.add_episode( + uuid=m.uuid, group_id=request.group_id, name=m.name, episode_body=f"{m.role or ''}({m.role_type}): {m.content}", diff --git a/server/graph_service/routers/retrieve.py b/server/graph_service/routers/retrieve.py index 57d697b0..2be5e0a8 100644 --- a/server/graph_service/routers/retrieve.py +++ b/server/graph_service/routers/retrieve.py @@ -29,7 +29,8 @@ async def search(query: SearchQuery, graphiti: ZepGraphitiDep): @router.get('/entity-edge/{uuid}', status_code=status.HTTP_200_OK) async def get_entity_edge(uuid: str, graphiti: ZepGraphitiDep): - return await graphiti.get_entity_edge(uuid) + entity_edge = await graphiti.get_entity_edge(uuid) + return get_fact_result_from_edge(entity_edge) @router.get('/episodes/{group_id}', status_code=status.HTTP_200_OK)