from pydantic_settings import BaseSettings from typing import Optional class Settings(BaseSettings): """服务配置""" # 服务基本配置 HOST: str = "0.0.0.0" PORT: int = 8003 DEBUG: bool = True # 服务名称 SERVICE_NAME: str = "speech-to-text" # 日志配置 LOG_LEVEL: str = "info" # 算法配置 DEFAULT_LANGUAGE: str = "zh" class Config: env_file = ".env" case_sensitive = True # 创建全局配置实例 settings = Settings()