File tree Expand file tree Collapse file tree 6 files changed +47
-17
lines changed Expand file tree Collapse file tree 6 files changed +47
-17
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,12 @@ description = "Add your description here"
55readme = " README.md"
66requires-python = " >=3.13"
77dependencies = [
8- " pre-commit>=4.2.0" ,
98 " pydantic>=2.11.7" ,
109 " pydantic-settings>=2.10.1" ,
1110 " streamlit>=1.47.0" ,
1211]
12+
13+ [project .optional-dependencies ]
14+ dev = [
15+ " pre-commit>=4.2.0" ,
16+ ]
Original file line number Diff line number Diff line change 1- .venv
2- .venv /*
31.venv /
Original file line number Diff line number Diff line change 11POSTGRES_USER = postgres # pragma: allowlist secret
2- POSTGRES_PASSWORD = mypassword # pragma: allowlist secret
3- POSTGRES_DB = laiive # pragma: allowlist secret
2+ POSTGRES_PASSWORD = yourpassword # pragma: allowlist secret
3+ POSTGRES_DB = yourdb # pragma: allowlist secret
44POSTGRES_PORT = 5432 # pragma: allowlist secret
5- POSTGRES_HOST = db # pragma: allowlist secret
5+ POSTGRES_HOST = dbhost # pragma: allowlist secret
66
7- # POSTGRES_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
8-
9- # retreiver Api key
7+ POSTGRES_URL = postgresql+asyncpg://postgres:yourpassword@dbhost:5432/yourdb # pragma: allowlist secret
8+ # Note: Manually replace values or construct this URL programmatically in your application
109OPENAI_API_KEY = " your-api-key" # pragma: allowlist secret
10+ MODEL_BASE = gpt-3.5-turbo
11+ MODEL_TEST = gpt-4o-mini
12+
13+ # backend configuration
14+ API_URL = http://backend:8000 # for local API_URL= http://loaclhost:8000
15+ HOST = 0.0.0.0
16+ PORT = 3000
Original file line number Diff line number Diff line change @@ -19,10 +19,15 @@ class Settings(BaseSettings):
1919 host : str = Field (..., alias = "HOST" )
2020 port : int = Field (..., alias = "PORT" )
2121
22- class Config :
23- env_file = ".env"
24- env_file_encoding = "utf-8"
25- case_sensitive = True
22+ from pydantic_settings import SettingsConfigDict
2623
24+ class Settings (BaseSettings ):
25+ # ... fields ...
26+
27+ model_config = SettingsConfigDict (
28+ env_file = ".env" ,
29+ env_file_encoding = "utf-8" ,
30+ case_sensitive = True ,
31+ )
2732
2833settings = Settings ()
Original file line number Diff line number Diff line change 1- .venv
2- .venv /*
31.venv /
Original file line number Diff line number Diff line change 11from pydantic_settings import BaseSettings , SettingsConfigDict
22
33
4- class db_parser_settings (BaseSettings ):
4+ # services/scraper/db_parser/config.py
5+
6+ from pydantic import BaseSettings
7+
8+ class DbParserSettings (BaseSettings ):
9+ # … (other settings fields)
510
11+ # … (any other module‐level code)
12+
13+ # Replace instantiation to match the new class name
14+ settings = DbParserSettings ()
615 POSTGRES_URL : str
716
817 model_config = SettingsConfigDict (
9- env_file = "../../.env" ,
18+ from pathlib import Path
19+
20+ PROJECT_ROOT = Path (__file__ ).parent .parent .parent
21+
22+ class db_parser_settings (BaseSettings ):
23+ POSTGRES_URL : str
24+
25+ model_config = SettingsConfigDict (
26+ env_file = str (PROJECT_ROOT / ".env" ),
1027 case_sensitive = False ,
1128 extra = "ignore" ,
29+ ) case_sensitive = False ,
30+ extra = "ignore" ,
1231 )
1332
1433 def __init__ (self , ** kwargs ):
You can’t perform that action at this time.
0 commit comments