hadith-api/app/config.py

43 lines
1.0 KiB
Python

from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
app_name: str = "Hadith Scholar API"
app_version: str = "0.1.0"
debug: bool = False
# PostgreSQL
pg_host: str = "pg.betelgeusebytes.io"
pg_port: int = 5432
pg_dbname: str = "hadith_db4"
pg_user: str = "hadith_ingest"
pg_password: str = "hadith_ingest"
pg_sslmode: str = "require"
# Neo4j
neo4j_uri: str = "neo4j+ssc://neo4j.betelgeusebytes.io:7687"
neo4j_user: str = "neo4j"
neo4j_password: str = "NEO4J-PASS"
# Qdrant
qdrant_host: str = "vector.betelgeusebytes.io"
qdrant_port: int = 443
qdrant_collection: str = "hadiths"
# Elasticsearch
es_host: str = "http://elasticsearch.elastic.svc.cluster.local:9200"
es_index: str = "hadiths"
# TEI (embeddings)
tei_url: str = "http://tei.ml.svc.cluster.local:80"
class Config:
env_file = ".env"
env_prefix = "HADITH_"
@lru_cache()
def get_settings() -> Settings:
return Settings()