Spaces:
Build error
Build error
Download src/chattr/agent/vector_database.py from AlphaSphereDotAI/Chattr: direct link, hf CLI and curl.
- Browser
- Download file 683 Bytes
-
https://huggingface.co/spaces/AlphaSphereDotAI/Chattr/resolve/main/src/chattr/agent/vector_database.py
- Command line
-
hf download hf://spaces/AlphaSphereDotAI/Chattr/src/chattr/agent/vector_database.py
-
curl -L -o vector_database.py https://huggingface.co/spaces/AlphaSphereDotAI/Chattr/resolve/main/src/chattr/agent/vector_database.py
683 Bytes
| from agno.utils.log import log_info | |
| from agno.vectordb.qdrant import Qdrant | |
| from chattr.app.settings import VectorDatabaseSettings | |
| def setup_vector_database(vectordb: VectorDatabaseSettings) -> Qdrant: | |
| """ | |
| Initialize a vector database connection. | |
| Args: | |
| vectordb (VectorDatabaseSettings): The settings required for | |
| connecting to the vector database. | |
| Returns: | |
| Qdrant: An instance of Qdrant configured with the specified vector database | |
| settings. | |
| """ | |
| log_info("Setting up vector database.") | |
| return Qdrant(collection=vectordb.name, url=vectordb.url.host, port=vectordb.url.port) | |