bitflicker64 commented on code in PR #396:
URL: https://github.com/apache/hugegraph-ai/pull/396#discussion_r4465356604
##########
hugegraph-llm/src/hugegraph_llm/config/index_config.py:
##########
@@ -15,22 +15,27 @@
# specific language governing permissions and limitations
# under the License.
-import os
-from typing import Optional
+from typing import ClassVar, Optional
from .models import BaseConfig
class IndexConfig(BaseConfig):
"""LLM settings"""
- qdrant_host: Optional[str] = os.environ.get("QDRANT_HOST", None)
- qdrant_port: int = int(os.environ.get("QDRANT_PORT", "6333"))
- qdrant_api_key: Optional[str] = os.environ.get("QDRANT_API_KEY") if
os.environ.get("QDRANT_API_KEY") else None
+ credential_endpoints: ClassVar[dict[str, tuple[str, ...]]] = {
+ "qdrant_api_key": ("qdrant_host", "qdrant_port"),
+ "milvus_user": ("milvus_host", "milvus_port"),
+ "milvus_password": ("milvus_host", "milvus_port"),
+ }
- milvus_host: Optional[str] = os.environ.get("MILVUS_HOST", None)
- milvus_port: int = int(os.environ.get("MILVUS_PORT", "19530"))
- milvus_user: str = os.environ.get("MILVUS_USER", "")
- milvus_password: str = os.environ.get("MILVUS_PASSWORD", "")
+ qdrant_host: Optional[str] = None
+ qdrant_port: int = 6333
+ qdrant_api_key: Optional[str] = None
Review Comment:
Important: a `QDRANT_API_KEY=` line, which old generated `.env` files and
key-clearing UI saves contain, now loads as `""` instead of `None`, and
`QdrantClient(api_key="")` defaults to `https`, so plain-HTTP Qdrant fails
after restart. Normalize an empty `qdrant_api_key` to `None`.
--
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]