Refactor backend configuration management and update environment settings

- Replace the `config.py` module with a new `settings.py` to streamline environment variable management, focusing on database, CORS, and TURN settings.
- Update references throughout the backend codebase to use the new `settings` module instead of the deprecated `config`.
- Modify the `.env.example` file to reflect the new configuration approach, indicating that model provider credentials should be maintained separately.
- Enhance the `AssistantConfig` model to clarify the source of runtime connection information, ensuring it is injected from model resources rather than relying on defaults from the environment.
- Introduce new user scripts for audio and video management in the Tampermonkey environment, enhancing WebRTC capabilities.
This commit is contained in:
Xin Wang
2026-07-09 21:40:29 +08:00
parent 195579c5b7
commit 35d24acf40
19 changed files with 106 additions and 139 deletions

View File

@@ -1,28 +1,6 @@
# 复制为 .env 并填入真实值。
# 国产栈走 OpenAI 兼容协议:每类服务给一个 base_url + api_key + 模型名即可
# ---- LLM:DeepSeek(OpenAI 兼容,直连云端,只需 key) ----
LLM_BASE_URL=https://api.deepseek.com/v1
LLM_API_KEY=sk-your-deepseek-key
LLM_MODEL=deepseek-chat
# ---- STT:SenseVoice / FunASR ----
# 需要本地起一个 OpenAI 兼容的语音转写服务(/v1/audio/transcriptions),
# 例如用 funasr / sherpa-onnx / speaches 包一层。下面填那个服务地址。
STT_BASE_URL=http://localhost:8001/v1
STT_API_KEY=local
STT_MODEL=sensevoice
# ---- TTS:CosyVoice ----
# 同样需要本地起一个 OpenAI 兼容的 TTS 服务(/v1/audio/speech)。
TTS_BASE_URL=http://localhost:8002/v1
TTS_API_KEY=local
TTS_MODEL=cosyvoice
TTS_VOICE=中文女
# ---- Realtime 模式(可选,先不接也行) ----
REALTIME_API_KEY=
REALTIME_MODEL=gpt-realtime
# 模型接入配置不再放在 .env;请在 model_resources 中维护 apiUrl/modelId/apiKey 等字段
# 开发环境可先执行 `make db-seed`,再到前端「组件 / 模型」里替换真实密钥。
# ---- 数据库(Postgres) ----
# 本地直连;docker compose 里则用 postgres:5432