27 lines
569 B
Python
27 lines
569 B
Python
from typing import Literal
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application configuration loaded from environment variables."""
|
|
|
|
llm_mode: Literal["local", "remote", "openai"] = "local"
|
|
llm_remote_url: str = ""
|
|
llm_remote_token: str = ""
|
|
|
|
# OpenAI configuration
|
|
openai_api_key: str = ""
|
|
openai_model: str = "gpt-4o-mini"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
|
|
|
|
# Constants
|
|
MAX_MESSAGE_LENGTH: int = 10_000
|
|
|
|
# Global settings instance
|
|
settings = Settings()
|