You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "MrJs133 (via GitHub)" <gi...@apache.org> on 2025/04/04 02:42:16 UTC

[PR] feat(llm):support graph checking before updating vid embedding [incubator-hugegraph-ai]

MrJs133 opened a new pull request, #205:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/205

   The vertex embedding is updated every hour. 
   
   **When a new user starts the program for the first time**, if the graph database related information is not configured, **many errors will occur, which affects the user experience.** 
   
   Therefore, **before updating the vertex embedding, it will check whether the current graph link is reachable.** 
   
   When the link is unreachable, **the effect is as follows:**
   ![Uploading 20250404-103740.jpeg…]()
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] feat(llm):support graph checking before updating vid embedding [incubator-hugegraph-ai]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin merged PR #205:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/205


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] feat(llm):support graph checking before updating vid embedding [incubator-hugegraph-ai]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #205:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/205#discussion_r2030710156


##########
hugegraph-llm/src/hugegraph_llm/utils/hugegraph_utils.py:
##########
@@ -168,3 +170,29 @@ def manage_backup_retention():
     except Exception as e:  # pylint: disable=W0718
         log.error("Failed to manage backup retention: %s", e, exc_info=True)
         raise Exception("Failed to manage backup retention") from e
+
+def check_graph_db_connection(
+    ip: str,
+    port: str,
+    name: str,
+    user: str,
+    pwd: str,
+    graph_space: str
+) -> bool:
+    try:
+        if graph_space and graph_space.strip():
+            test_url = f"http://{ip}:{port}/graphspaces/{graph_space}/graphs/{name}/schema"
+        else:
+            test_url = f"http://{ip}:{port}/graphs/{name}/schema"
+        auth = HTTPBasicAuth(user, pwd)
+        response = requests.get(test_url, timeout=(1.0, 5.0), auth=auth)
+        return response.status_code == 200
+    except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
+        log.warning("GraphDB connection error: %s", str(e))
+        return False
+    except ConnectionError as e:
+        log.warning("network connection error: %s", str(e))
+        return False

Review Comment:
   Catching ConnectionError separately may be redundant since requests.exceptions.RequestException already covers connection-related errors. Consider consolidating these exception handlers.
   ```suggestion
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org