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


##########
hugegraph-llm/pyproject.toml:
##########
@@ -85,3 +86,4 @@ allow-direct-references = true
 
 [tool.uv.sources]
 hugegraph-python-client = { workspace = true }
+pycgraph = { git = "https://github.com/ChunelFeng/CGraph.git";, subdirectory = 
"python", rev = "main", marker = "sys_platform == 'linux'"  }

Review Comment:
   ‼️ **Critical: Platform-Specific Dependency Issue**
   
   The `pycgraph` dependency is restricted to Linux only:
   ```python
   pycgraph = { git = "https://github.com/ChunelFeng/CGraph.git";, subdirectory 
= "python", rev = "main", marker = "sys_platform == 'linux'"  }
   ```
   
   This will break on macOS and Windows platforms. Consider:
   1. Making it cross-platform compatible
   2. Providing fallback implementation for other platforms
   3. Clearly documenting platform limitations in README
   
   This is a blocking issue for cross-platform users.



##########
hugegraph-llm/src/hugegraph_llm/api/rag_api.py:
##########
@@ -181,6 +204,13 @@ def text2gremlin_api(req: GremlinGenerateRequest):
         try:
             set_graph_config(req)
 
+            # Basic parameter validation: empty query => 400

Review Comment:
   ‼️ **Critical: Inconsistent Query Validation**
   
   Empty query validation is only added to `text2gremlin_api`:
   ```python
   if not req.query or not str(req.query).strip():
       raise HTTPException(
           status_code=status.HTTP_400_BAD_REQUEST,
           detail="Query must not be empty.",
       )
   ```
   
   However, other endpoints like `rag_answer_api` and `graph_rag_recall_api` 
also accept queries but lack this validation. 
   
   **Recommendation**: Apply consistent validation across all query-accepting 
endpoints to prevent potential errors downstream.



-- 
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