A Simple and Universal Swarm Intelligence Engine, Predicting Anything. 简洁通用的群体智能引擎,预测万物
Python agent-memoryfinancial-forecastingfuture-predictionknowledge-graphllmsmulti-agent-simulationpublic-opinion-analysispython3social-predictionswarm-intelligence
fix: use the supported Zep node-edge method
666ghj0d8c23a3c28b
diff --git a/backend/app/services/zep_entity_reader.py b/backend/app/services/zep_entity_reader.pyindex 71661be4..d94c6c3f 100644--- a/backend/app/services/zep_entity_reader.py+++ b/backend/app/services/zep_entity_reader.py@@ -192,7 +192,7 @@ class ZepEntityReader:try:# 使用重试机制调用Zep APIedges = self._call_with_retry(- func=lambda: self.client.graph.node.get_entity_edges(node_uuid=node_uuid),+ func=lambda: self.client.graph.node.get_edges(node_uuid=node_uuid),operation_name=f"获取节点边(node={node_uuid[:8]}...)")@@ -434,4 +434,3 @@ class ZepEntityReader:)return result.entities-diff --git a/backend/tests/test_zep_entity_reader_edges.py b/backend/tests/test_zep_entity_reader_edges.pynew file mode 100644index 00000000..af5a09cd--- /dev/null+++ b/backend/tests/test_zep_entity_reader_edges.py@@ -0,0 +1,44 @@+from types import SimpleNamespace++from app.services.zep_entity_reader import ZepEntityReader+from zep_cloud.graph.node.client import NodeClient+++def test_pinned_zep_sdk_exposes_get_edges_not_get_entity_edges():+ assert hasattr(NodeClient, "get_edges")+ assert not hasattr(NodeClient, "get_entity_edges")+++def test_get_node_edges_uses_the_supported_sdk_method():+ calls = []++ class NodeApi:+ def get_edges(self, *, node_uuid):+ calls.append(node_uuid)+ return [SimpleNamespace(+ uuid_="edge-1",+ name="KNOWS",+ fact="Alice knows Bob",+ source_node_uuid="node-1",+ target_node_uuid="node-2",+ attributes={"since": "2024"},+ )]++ class GraphApi:+ node = NodeApi()++ class Client:+ graph = GraphApi()++ reader = object.__new__(ZepEntityReader)+ reader.client = Client()++ assert reader.get_node_edges("node-1") == [{+ "uuid": "edge-1",+ "name": "KNOWS",+ "fact": "Alice knows Bob",+ "source_node_uuid": "node-1",+ "target_node_uuid": "node-2",+ "attributes": {"since": "2024"},+ }]+ assert calls == ["node-1"]