mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
55 lines
1.3 KiB
Python
55 lines
1.3 KiB
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables"""
|
|
|
|
# Database Configuration
|
|
DATABASE_URL: str
|
|
|
|
# AWS S3 Configuration
|
|
AWS_ACCESS_KEY_ID: str
|
|
AWS_SECRET_ACCESS_KEY: str
|
|
AWS_REGION: str = "us-east-1"
|
|
S3_BUCKET_NAME: str
|
|
S3_ENDPOINT_URL: str | None = None
|
|
S3_PUBLIC_BASE_URL: str | None = None
|
|
|
|
# Security
|
|
SECRET_KEY: str
|
|
|
|
# Server Configuration
|
|
HOST: str = "0.0.0.0"
|
|
PORT: int = 8080
|
|
DEBUG: bool = False
|
|
|
|
# Token Configuration
|
|
TOKEN_EXPIRE_DAYS: int = 7
|
|
|
|
# Fish Audio Configuration
|
|
FISH_API_KEY: str
|
|
|
|
# OpenAI Configuration
|
|
OPENAI_API_KEY: str
|
|
OPENAI_MODEL: str = "gpt-4o-mini"
|
|
OPENAI_BASE_URL: str = "https://api.openai.com/v1"
|
|
|
|
# MemU Configuration
|
|
MEMU_API_KEY: str = ""
|
|
MEMU_BASE_URL: str = "https://api.memu.so"
|
|
|
|
# OpenRouter Configuration
|
|
OPENROUTER_API_KEY: str
|
|
OPENROUTER_BASE_URL: str = "https://openrouter.ai/api/v1"
|
|
QUICK_PERSONA_MODEL: str = "google/gemini-2.5-flash"
|
|
OPTIMIZE_PERSONA_MODEL: str = "google/gemini-3-pro-preview"
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
env_file_encoding="utf-8",
|
|
case_sensitive=True
|
|
)
|
|
|
|
|
|
settings = Settings()
|
|
|