imbajin commented on code in PR #304:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/304#discussion_r2465618317
##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/configs_block.py:
##########
@@ -106,6 +106,83 @@ def test_api_connection(
return resp.status_code
+def apply_vector_engine(engine: str):
+ # Persist the vector engine selection
+ setattr(index_settings, "cur_vector_index", engine)
Review Comment:
⚠️ **可维护性问题**: 使用 `setattr` 动态设置属性会降低代码的可读性和类型安全性。
```python
setattr(index_settings, "cur_vector_index", engine)
```
建议直接赋值:
```python
index_settings.cur_vector_index = engine
```
这样更清晰,且 IDE 和类型检查工具能提供更好的支持。
--
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]