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


##########
hugegraph-llm/pyproject.toml:
##########
@@ -92,3 +100,22 @@ hugegraph-python-client = { workspace = true }
 # We encountered a bug in PyCGraph's latest release version, so we're using a 
specific commit from the main branch (without the bug) as the project 
dependency.
 # TODO: Replace this command in the future when a new PyCGraph release version 
(after 3.1.2) is available.
 pycgraph = { git = "https://github.com/ChunelFeng/CGraph.git";, subdirectory = 
"python", rev = "248bfcfeddfa2bc23a1d585a3925c71189dba6cc"}
+
+[tool.mypy]
+disable_error_code = ["import-untyped"]

Review Comment:
   🧹 **文档完整性**: `pyproject.toml` 中添加了 ruff 和 mypy 配置,这很好。但建议:
   
   1. 在项目 README 中说明如何运行这些工具
   2. 考虑在 CI/CD 流程中集成这些检查
   3. `disable_error_code = ["import-untyped"]` 可能会隐藏一些类型问题,建议逐步修复这些问题而不是全局禁用



##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/configs_block.py:
##########
@@ -653,6 +730,54 @@ def reranker_settings(reranker_type):
                 inputs=reranker_config_input,  # pylint: disable=no-member
             )
 
+    with gr.Accordion("5. Set up the vector engine.", open=False):
+        engine_selector = gr.Dropdown(
+            choices=["Faiss", "Milvus", "Qdrant"],
+            value=index_settings.cur_vector_index,
+            label="Select vector engine.",
+        )
+        engine_selector.select(
+            fn=lambda engine: setattr(index_settings, "cur_vector_index", 
engine),
+            inputs=[engine_selector],
+        )
+
+        @gr.render(inputs=[engine_selector])
+        def vector_engine_settings(engine):
+            if engine == "Milvus":
+                with gr.Row():
+                    milvus_inputs = [
+                        gr.Textbox(value=index_settings.milvus_host, 
label="host"),
+                        gr.Textbox(value=str(index_settings.milvus_port), 
label="port"),
+                        gr.Textbox(value=index_settings.milvus_user, 
label="user"),
+                        gr.Textbox(
+                            value=index_settings.milvus_password, 
label="password", type="password"
+                        ),
+                    ]
+                apply_backend_button = gr.Button("Apply Configuration")
+                apply_backend_button.click(
+                    partial(apply_vector_engine_backend, "Milvus"), 
inputs=milvus_inputs
+                )
+            elif engine == "Qdrant":
+                with gr.Row():
+                    qdrant_inputs = [
+                        gr.Textbox(value=index_settings.qdrant_host, 
label="host"),
+                        gr.Textbox(value=str(index_settings.qdrant_port), 
label="port"),
+                        gr.Textbox(
+                            value=(index_settings.qdrant_api_key or ""),
+                            label="api_key",
+                            type="password",
+                        ),
+                    ]
+                apply_backend_button = gr.Button("Apply Configuration")
+                apply_backend_button.click(
+                    lambda h, p, k: apply_vector_engine_backend("Qdrant", h, 
p, None, None, k),
+                    inputs=qdrant_inputs,
+                )
+            else:
+                gr.Markdown("✅ Faiss 本地索引无需额外配置。")

Review Comment:
   🧹 **用户体验**: 在 Gradio UI 中,"✅ Faiss 本地索引无需额外配置" 这个提示很好,但建议:
   
   1. 其他引擎配置成功后也显示类似的友好提示
   2. 配置失败时显示更详细的错误信息和解决建议
   3. 考虑添加配置状态指示器(如绿色勾号表示已配置)



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