File size: 545 Bytes
82f9be0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
配置管理模块
"""

from pydantic_settings import BaseSettings
from typing import Optional


class Settings(BaseSettings):
    """系统配置"""
    
    # Redis配置
    redis_host: str = "localhost"
    redis_port: int = 6379
    redis_db: int = 0
    redis_password: Optional[str] = None
    
    # API配置
    api_host: str = "0.0.0.0"
    api_port: int = 7860
    debug: bool = True
    
    # 日志配置
    log_level: str = "INFO"
    
    class Config:
        env_file = ".env"


# 全局配置实例
settings = Settings()