imbajin commented on code in PR #302:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/302#discussion_r2447067940


##########
hugegraph-llm/src/hugegraph_llm/api/rag_api.py:
##########
@@ -102,15 +122,11 @@ def graph_rag_recall_api(req: GraphRAGRequest):
                 near_neighbor_first=req.near_neighbor_first,
                 custom_related_information=req.custom_priority_info,
                 gremlin_prompt=req.gremlin_prompt or 
prompt.gremlin_generate_prompt,
-                get_vertex_only=req.get_vertex_only
+                get_vertex_only=req.get_vertex_only,
             )
 
             if req.get_vertex_only:

Review Comment:
   ⚠️ **Important: Function extraction improves maintainability**
   
   Good refactoring to extract vertex details logic! However, consider a few 
enhancements:
   
   1. The function name `get_vertex_details` doesn't indicate it's a utility
   2. Error handling in this extracted function isn't clear from the diff
   
   **Recommendation**:
   - Ensure `get_vertex_details` has proper docstrings explaining parameters 
and return values
   - Add type hints for better IDE support
   - Handle cases where `match_vids` is empty or malformed



##########
hugegraph-llm/src/hugegraph_llm/api/models/rag_requests.py:
##########
@@ -24,10 +24,10 @@
 
 
 class GraphConfigRequest(BaseModel):
-    url: str = Query('127.0.0.1:8080', description="hugegraph client url.")
-    graph: str = Query('hugegraph', description="hugegraph client name.")
-    user: str = Query('', description="hugegraph client user.")
-    pwd: str = Query('', description="hugegraph client pwd.")
+    url: str = Query("127.0.0.1:8080", description="hugegraph client url.")

Review Comment:
   🧹 **Minor: Code formatting improvements applied**
   
   Good job using consistent formatting tools (likely black/ruff). The line 
length and quote style are now consistent across the codebase. This improves 
readability and reduces merge conflicts.
   
   Consider adding a pre-commit hook or CI check to enforce this formatting 
automatically for future contributions.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to