55 lines
1.4 KiB
Python
55 lines
1.4 KiB
Python
from pathlib import Path
|
|
|
|
from pydantic import Field
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application configuration from environment variables."""
|
|
|
|
model_config = SettingsConfigDict(env_file=".env")
|
|
|
|
# GCP General
|
|
gcp_project_id: str
|
|
gcp_location: str
|
|
|
|
# RAG
|
|
rag_endpoint_url: str
|
|
|
|
# Firestore
|
|
firestore_database_id: str = Field(..., alias="GCP_FIRESTORE_DATABASE_ID")
|
|
firestore_host: str = Field(
|
|
default="firestore.googleapis.com", alias="GCP_FIRESTORE_HOST",
|
|
)
|
|
firestore_port: int = Field(default=443, alias="GCP_FIRESTORE_PORT")
|
|
firestore_importer_enabled: bool = Field(
|
|
default=False, alias="GCP_FIRESTORE_IMPORTER_ENABLE",
|
|
)
|
|
|
|
# Redis
|
|
redis_host: str
|
|
redis_port: int
|
|
redis_pwd: str | None = None
|
|
|
|
# DLP
|
|
dlp_template_complete_flow: str
|
|
|
|
# Conversation Context
|
|
conversation_context_message_limit: int = Field(
|
|
default=60, alias="CONVERSATION_CONTEXT_MESSAGE_LIMIT",
|
|
)
|
|
conversation_context_days_limit: int = Field(
|
|
default=30, alias="CONVERSATION_CONTEXT_DAYS_LIMIT",
|
|
)
|
|
|
|
# Logging
|
|
log_level: str = Field(default="INFO", alias="LOGGING_LEVEL_ROOT")
|
|
|
|
@property
|
|
def base_path(self) -> Path:
|
|
"""Get base path for resources."""
|
|
return Path(__file__).parent.parent / "resources"
|
|
|
|
|
|
settings = Settings.model_validate({})
|