File size: 678 Bytes
6ab28e5
 
 
9bc4a6c
 
 
2c70642
 
 
 
 
6ab28e5
2c70642
6ab28e5
9bc4a6c
 
2c70642
9bc4a6c
 
2c70642
9bc4a6c
 
 
 
2c70642
 
 
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
import os


SAAS = True


def get_db_config(cname="nvdajp-book"):
    if cname == "nvdajp-book":
        url = os.environ["QDRANT_URL"]
    elif cname == "nvdajp-book-e5":
        url = os.environ["QDRANT_E5_URL"]
    api_key = os.environ["QDRANT_API_KEY"]
    collection_name = cname
    return url, api_key, collection_name


def get_local_db_congin(cname="nvdajp-book"):
    url = "localhost"
    # api_key = os.environ["QDRANT_API_KEY"]
    collection_name = cname
    return url, None, collection_name


DB_CONFIG = get_db_config() if SAAS else get_local_db_congin()
DB_E5_CONFIG = (
    get_db_config("nvdajp-book-e5") if SAAS else get_local_db_congin("nvdajp-book-e5")
)