Files
duocthu/apps/ai-service/config.py
T

41 lines
1.4 KiB
Python

from __future__ import annotations
from functools import lru_cache
from pathlib import Path
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
app_name: str = "vsf-duoc-thu-ai-service"
qdrant_url: str = "http://localhost:6333"
qdrant_collection: str = "duocthu_v1"
qdrant_api_key: str | None = None
postgres_dsn: str = Field(
default="postgresql://duoc_thu:duoc_thu@localhost:5432/duoc_thu",
repr=False,
)
# Defaults to the route that is measured and needs no provider. Raising it
# to `cohere-v4` enables the similarity fallback and requires live Bedrock.
embedding_provider: str = "section-only"
embedding_dimensions: int = 1024
evidence_minimum_score: float = 0.12
aws_region: str = "us-east-1"
# Generation is off unless asked for. `stub` runs the whole answer path —
# prompt, schema parsing, grounding check, fallback — with no cloud call.
answer_provider: str = "disabled"
answer_model_id: str = "anthropic.claude-opus-5"
metrics_enabled: bool = True
entities_path: Path = (
Path(__file__).resolve().parents[2]
/ "ingestion/data/verified/drug_entities.json"
)
@lru_cache
def get_settings() -> Settings:
return Settings()