Files

32 lines
661 B
Python

from pydantic_settings import BaseSettings
from typing import Optional
class Settings(BaseSettings):
"""服务配置"""
# 服务基本配置
HOST: str = "0.0.0.0"
PORT: int = 8004
DEBUG: bool = True
# 服务名称
SERVICE_NAME: str = "openai-proxy"
# 日志配置
LOG_LEVEL: str = "info"
# OpenAI配置
API_KEY: Optional[str] = None
API_BASE: str = "https://api.openai.com/v1"
MODEL: str = "gpt-3.5-turbo"
TEMPERATURE: float = 0.7
MAX_TOKENS: int = 1000
class Config:
env_file = ".env"
case_sensitive = True
# 创建全局配置实例
settings = Settings()