This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-ai.git
The following commit(s) were added to refs/heads/dev by this push:
new 66665de fix settings error
66665de is described below
commit 66665de4a2a69f8529c928c8224a3ab7973ee8b5
Author: imbajin <[email protected]>
AuthorDate: Mon Dec 23 12:32:00 2024 +0800
fix settings error
---
.../src/hugegraph_llm/operators/graph_rag_task.py | 14 ++++++++-----
.../operators/hugegraph_op/graph_rag_query_acg.py | 24 +++++++++++-----------
2 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/hugegraph-llm/src/hugegraph_llm/operators/graph_rag_task.py
b/hugegraph-llm/src/hugegraph_llm/operators/graph_rag_task.py
index 9e05de8..836af52 100644
--- a/hugegraph-llm/src/hugegraph_llm/operators/graph_rag_task.py
+++ b/hugegraph-llm/src/hugegraph_llm/operators/graph_rag_task.py
@@ -17,7 +17,7 @@
from typing import Dict, Any, Optional, List, Literal
-from hugegraph_llm.config import settings
+from hugegraph_llm.config import huge_settings
from hugegraph_llm.models.embeddings.base import BaseEmbedding
from hugegraph_llm.models.embeddings.init_embedding import Embeddings
from hugegraph_llm.models.llms.base import BaseLLM
@@ -140,11 +140,15 @@ class RAGPipeline:
:param prop_to_match: Property to match in the graph.
:return: Self-instance for chaining.
"""
- if settings.graph_space == "acgraggs":
+ if huge_settings.graph_space == "acgraggs":
self._operators.append(
- GraphRAGACGQuery(max_deep=max_deep,
max_v_prop_len=max_v_prop_len,
- max_e_prop_len=max_e_prop_len,
prop_to_match=prop_to_match,
- with_gremlin_template=with_gremlin_template)
+ GraphRAGACGQuery(
+ max_deep=max_deep,
+ max_v_prop_len=max_v_prop_len,
+ max_e_prop_len=max_e_prop_len,
+ prop_to_match=prop_to_match,
+ with_gremlin_template=with_gremlin_template
+ )
)
else:
self._operators.append(
diff --git
a/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query_acg.py
b/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query_acg.py
index 7de8f81..bd42895 100644
---
a/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query_acg.py
+++
b/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query_acg.py
@@ -19,7 +19,7 @@ import json
import requests
from typing import Any, Dict, Optional, List, Set, Tuple
-from hugegraph_llm.config import settings
+from hugegraph_llm.config import huge_settings
from hugegraph_llm.models.embeddings.base import BaseEmbedding
from hugegraph_llm.models.llms.base import BaseLLM
from hugegraph_llm.operators.gremlin_generate_task import GremlinGenerator
@@ -51,10 +51,10 @@ g.V({keywords}).bothE({edge_labels}).otherV().dedup()
def get_paths_vertex_id(sources, targets, depth=2, capacity=100, limit=100):
log.debug(f"Get_Paths: {sources}, {targets}")
- graph_ip = settings.graph_ip
- graph_port = settings.graph_port
- graph_space = settings.graph_space
- graph_name = settings.graph_name
+ graph_ip = huge_settings.graph_ip
+ graph_port = huge_settings.graph_port
+ graph_space = huge_settings.graph_space
+ graph_name = huge_settings.graph_name
# 定义请求 URL 和头部
url =
f'http://{graph_ip}:{graph_port}/graphspaces/{graph_space}/graphs/{graph_name}/traversers/paths'
headers = {
@@ -102,17 +102,17 @@ class GraphRAGACGQuery:
num_gremlin_generate_example: int = 1
):
self._client = PyHugeClient(
- settings.graph_ip,
- settings.graph_port,
- settings.graph_name,
- settings.graph_user,
- settings.graph_pwd,
- settings.graph_space,
+ huge_settings.graph_ip,
+ huge_settings.graph_port,
+ huge_settings.graph_name,
+ huge_settings.graph_user,
+ huge_settings.graph_pwd,
+ huge_settings.graph_space,
)
self._max_deep = max_deep
self._prop_to_match = prop_to_match
self._schema = ""
- self._limit_property = settings.limit_property.lower() == "true"
+ self._limit_property = huge_settings.limit_property.lower() == "true"
self._max_v_prop_len = max_v_prop_len
self._max_e_prop_len = max_e_prop_len
self._gremlin_generator = GremlinGenerator(