Spaces:
Running
Running
File size: 733 Bytes
cd3709a a9edb90 cd3709a c56ab56 cd3709a c56ab56 cd3709a b6dd5cc 240fe8a c1dc2ee 240fe8a b6dd5cc 240fe8a cd3709a b6dd5cc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import os
SAAS = True
def get_db_config():
url = os.environ["QDRANT_URL"]
api_key = os.environ["QDRANT_API_KEY"]
collection_name = "document-search"
return url, api_key, collection_name
def get_local_db_congin():
url = "localhost"
# api_key = os.environ["QDRANT_API_KEY"]
collection_name = "document-search"
return url, None, collection_name
def get_index_names():
keys = [
k for k in [
k.strip().lower()
for k in os.environ.get("INDEX_NAMES", "").split(",")
]
if k
]
if not keys:
keys = ["INDEX_NAMES is empty"]
return keys
DB_CONFIG = get_db_config() if SAAS else get_local_db_congin()
INDEX_NAMES = get_index_names() |