Spaces:
Sleeping
Sleeping
Download app/core/vector_db.py from D4rkbyte/tuklascope-api: direct link, hf CLI and curl.
- Browser
- Download file 567 Bytes
-
https://huggingface.co/spaces/D4rkbyte/tuklascope-api/resolve/main/app/core/vector_db.py
- Command line
-
hf download hf://spaces/D4rkbyte/tuklascope-api/app/core/vector_db.py
-
curl -L -o vector_db.py https://huggingface.co/spaces/D4rkbyte/tuklascope-api/resolve/main/app/core/vector_db.py
567 Bytes
| from qdrant_client import QdrantClient | |
| from app.core.config import settings | |
| def get_qdrant_client() -> QdrantClient | None: | |
| """ | |
| Initializes the Qdrant Vector DB client. | |
| Fails safely if credentials are not yet added to the .env file. | |
| """ | |
| if not settings.QDRANT_URL or not settings.QDRANT_API_KEY: | |
| print("Warning: Qdrant credentials missing. Running Tutor in standard LLM mode without Vector Search.") | |
| return None | |
| return QdrantClient(url=settings.QDRANT_URL, api_key=settings.QDRANT_API_KEY) | |
| qdrant_db = get_qdrant_client() | |