Repository navigation
Expand file tree
/
Copy pathConfig.py
More file actions
59 lines (53 loc) · 2.28 KB
/
Copy pathConfig.py
File metadata and controls
59 lines (53 loc) · 2.28 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from dotenv import load_dotenv
import os
from pydantic import BaseModel
load_dotenv(override=True)
class Config(BaseModel):
NCBI_EMAIL: str = os.getenv("NCBI_EMAIL")
NCBI_API_KEY: str = os.getenv("NCBI_API_KEY")
BASE_EUTILS: str = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"
BASE_BIOC: str = "https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi"
FTP_HOST: str = "ftp.ncbi.nlm.nih.gov"
FTP_USER: str = os.getenv("FTP_USER")
FTP_PASSWORD: str = os.getenv("FTP_PASSWORD")
PMC_OA_SERVICE: str = "https://www.ncbi.nlm.nih.gov/pmc/utils/oa/oa.fcgi"
PDF_DIR: str = os.path.join(os.path.dirname(__file__), "pdfs")
CHUNK_SIZE: int = 256 * 1024
MODEL_DIR: str = os.path.join(
os.path.dirname(__file__), "models/saved_multitask_model"
)
MODEL_NAME: str = "gpt-4.1-mini"
PGVECTOR_URL: str = os.getenv("PGVECTOR_URL")
PGVECTOR_TABLE: str = os.getenv("PGVECTOR_TABLE")
PGVECTOR_CONTENTS_URL: str = os.getenv("PGVECTOR_CONTENTS_URL")
PGVECTOR_CONTENTS_TABLE: str = os.getenv("PGVECTOR_CONTENTS_TABLE")
SQL_DATABASE_URL: str = os.getenv("SQL_DATABASE_URL")
EMBEDDING_MODEL: str = "text-embedding-3-small"
OPENAI_API_KEY: str = os.getenv("OPENAI_API_KEY")
OPENALEX_BASE: str = "https://api.openalex.org/works"
OPENALEX_MAILTO: str = os.getenv("OPENALEX_MAILTO")
COMMON_HEADERS: dict[str, str] = {
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/129.0.0.0 Safari/537.36"
),
"Accept": "application/pdf,application/octet-stream;q=0.9,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Connection": "keep-alive",
"DNT": "1",
}
HEADLESS: bool = True
PGVECTOR_MEMORY_URL: str = os.getenv("PGVECTOR_MEMORY_URL")
PGVECTOR_MEMORY_TABLE: str = os.getenv("PGVECTOR_MEMORY_TABLE")
# Gap Analysis
GAP_REPORTS_TABLE: str = os.getenv("GAP_REPORTS_TABLE", "gap_reports")
GAP_REPORTS_DB_URL: str = os.getenv(
"GAP_REPORTS_DB_URL", os.getenv("SQL_DATABASE_URL")
)
GAP_LLM_BATCH_SIZE: int = 5
GAP_LLM_CONCURRENCY: int = 5
GAP_DEFAULT_SCOPE: int = 100
GAP_DEFAULT_DAYS: int = 180
config = Config()