-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Bug Type (问题类型)
exception / error (异常报错)
Before submit
- I had searched in the issues and found no similar issues.
Environment (环境信息)
- Server Version: v1.5.0
- Instance Running: incubator-hugegraph-ai\hugegraph-llm\src\hugegraph_llm\demo\rag_demo
- Directory: incubator-hugegraph-ai/hugegraph-llm/src
- Command: python -m hugegraph_llm.demo.rag_demo.app
- Python version: 3.9.13
- Windows 11
Expected & Actual behavior (期望与实际表现)
Source of Issue: C:\Users\Khwaish.vscode\incubator-hugegraph-ai\hugegraph-python-client\src\pyhugegraph\utils\huge_config.py
Problematic Code:
line 66:
except Exception as e: # pylint: disable=broad-exception-caught
traceback.print_exception(e)
self.gs_supported = False
log.warning(
"Failed to retrieve API version information from the server, reverting to default v1."
)
Expected Behavior: Upon clicking "Extract Graph Data", the output should be generated for the RAG index builder.
Actual Behavior: Error thrown and unable to perform "Extract Graph Data". Displays errors on both the console and the UI.
Error: Traceback (most recent call last):
File "C:\Users\Khwaish.vscode\incubator-hugegraph-ai.venv\lib\site-packages\pyhugegraph\utils\huge_config.py", line 68, in post_init
traceback.print_exception(e)
TypeError: print_exception() missing 2 required positional arguments: 'value' and 'tb'
Cause of error discovered:
The traceback.print_exception function requires two more positional arguments, value and tb, which are not provided in the calls from KG Builder.
i.e:
builder = KgBuilder(LLMs().get_chat_llm(), Embeddings().get_embedding(), get_hg_client())
File "C:\Users\Khwaish\.vscode\incubator-hugegraph-ai\hugegraph-llm\src\hugegraph_llm\utils\hugegraph_utils.py", line 39, in get_hg_client
return PyHugeClient(
File "C:\Users\Khwaish\.vscode\incubator-hugegraph-ai\.venv\lib\site-packages\pyhugegraph\client.py", line 59, in __init__
self.cfg = HGraphConfig(ip, port, user, pwd, graph, graphspace, timeout or (0.5, 15.0))
File "<string>", line 11, in __init__
File "C:\Users\Khwaish\.vscode\incubator-hugegraph-ai\.venv\lib\site-packages\pyhugegraph\utils\huge_config.py", line 66, in __post_init__
traceback.print_exception(e)
Solution discovered:
builder = KgBuilder(LLMs().get_chat_llm(), Embeddings().get_embedding(), get_hg_client())
File "C:\Users\Khwaish\.vscode\incubator-hugegraph-ai\hugegraph-llm\src\hugegraph_llm\utils\hugegraph_utils.py", line 39, in get_hg_client
return PyHugeClient(
File "C:\Users\Khwaish\.vscode\incubator-hugegraph-ai\.venv\lib\site-packages\pyhugegraph\client.py", line 59, in __init__
self.cfg = HGraphConfig(ip, port, user, pwd, graph, graphspace, timeout or (0.5, 15.0))
File "<string>", line 11, in __init__
File "C:\Users\Khwaish\.vscode\incubator-hugegraph-ai\.venv\lib\site-packages\pyhugegraph\utils\huge_config.py", line 66, in __post_init__
exc_type, exc_value, tb = sys.exc_info()
traceback.print_exception(exc_type, exc_value, tb)
Actual Behavior:
During the try block, throws exception in the console, then proceeds to complete functions.