Files
tts_trans/app/config.py
sunruiling 2a87020b48 refactor: 精简架构,去掉书籍管理,核心 TTS 代理
- 去掉 books/chapters CRUD、SQLAlchemy、SQLite 依赖
- 核心只剩 /api/tts + 智能分段 + 自动重试
- 新增 API_TOKEN 环境变量,管理接口 Bearer Token 鉴权
- 管理接口精简为 preview + config
- 前端重写:TTS 试听 + 配置查看 + 接口文档
- Dockerfile/docker-compose 清理,去掉数据库卷
2026-03-27 15:10:58 +08:00

22 lines
731 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# 小米 MiMo TTS API 配置
MIMO_API_ENDPOINT = os.environ.get(
"MIMO_API_ENDPOINT", "https://api.xiaomimimo.com/v1/chat/completions"
)
MIMO_API_KEY = os.environ.get("MIMO_API_KEY", "")
MIMO_TTS_MODEL = os.environ.get("MIMO_TTS_MODEL", "mimo-v2-audio-tts")
MIMO_VOICE = os.environ.get("MIMO_VOICE", "mimo_default")
# 服务器配置
SERVER_HOST = os.environ.get("SERVER_HOST", "0.0.0.0")
SERVER_PORT = int(os.environ.get("SERVER_PORT", "3333"))
# API 访问令牌(可选,设置后管理接口需要 Bearer Token
API_TOKEN = os.environ.get("API_TOKEN", "")
# 音频存储目录
AUDIO_DIR = os.environ.get("AUDIO_DIR", os.path.join(BASE_DIR, "audio"))