-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
41 lines (32 loc) · 1.33 KB
/
Copy pathconfig.py
File metadata and controls
41 lines (32 loc) · 1.33 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
from pathlib import Path
from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic import BaseModel
class Paths(BaseModel):
project_root: Path = Path(__file__).resolve().parent
data_raw: Path = project_root / "data" / "raw"
data_processed: Path = project_root / "data" / "processed"
data_indices: Path = project_root / "data" / "indices"
def setup(self):
self.data_raw.mkdir(parents=True, exist_ok=True)
self.data_processed.mkdir(parents=True, exist_ok=True)
self.data_indices.mkdir(parents=True, exist_ok=True)
class AppConfig(BaseSettings):
paths: Paths = Paths()
model_name: str = "sentence-transformers/all-MiniLM-L6-v2"
batch_size: int = 16
vector_db_path: str = str(Paths().data_indices / "chroma")
graph_db_url: str = "networkx" # Default prototype using networkx, could be bolt://localhost:7687
openai_api_key: str = ""
gemini_api_key: str = ""
groq_api_key: str = ""
grok_api_key: str = ""
hf_api_key: str = ""
llm_provider: str = "google-genai" # Or openai, groq, grok, huggingface
model_config = SettingsConfigDict(
env_file=str(Path(__file__).resolve().parent / ".env"),
env_file_encoding="utf-8",
extra="ignore"
)
config = AppConfig()
config.paths.setup()
__all__ = ["config", "AppConfig", "Paths"]