This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-ai.git
The following commit(s) were added to refs/heads/main by this push:
new 1c9bb5e feat(llm): add post method for paths-api (#162)
1c9bb5e is described below
commit 1c9bb5e58ff01162addf3efd4e3ca0496cdd452e
Author: SoJGooo <[email protected]>
AuthorDate: Fri Feb 7 15:32:42 2025 +0800
feat(llm): add post method for paths-api (#162)
---
.../src/pyhugegraph/api/traverser.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/hugegraph-python-client/src/pyhugegraph/api/traverser.py
b/hugegraph-python-client/src/pyhugegraph/api/traverser.py
index f9dbbb2..628c3f4 100644
--- a/hugegraph-python-client/src/pyhugegraph/api/traverser.py
+++ b/hugegraph-python-client/src/pyhugegraph/api/traverser.py
@@ -114,6 +114,26 @@ class TraverserManager(HugeParamsBase):
def paths(self, source_id, target_id, max_depth): # pylint:
disable=unused-argument
return self._invoke_request()
+ @router.http("POST", 'traversers/paths')
+ def advanced_paths(
+ self, sources, targets, step, max_depth, nearest=True,
capacity=10000000, limit=10, with_vertex=False
+ ):
+ return self._invoke_request(
+ data=json.dumps(
+ {
+ "sources": sources,
+ "targets": targets,
+ "step": step,
+ "max_depth": max_depth,
+ "nearest": nearest,
+ "capacity": capacity,
+ "limit": limit,
+ "with_vertex": with_vertex,
+ }
+ )
+ )
+
+
@router.http("POST", "traversers/customizedpaths")
def customized_paths(
self, sources, steps, sort_by="INCR", with_vertex=True, capacity=-1,
limit=-1