Initial commit: AI Video Assistant fullstack platform.
Add pipecat-based backend with WebRTC/WS voice routes, Next.js frontend, and Docker Compose orchestration. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
43
backend/config.py
Normal file
43
backend/config.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""集中读取环境变量。所有 provider 的接入点都在这里,改栈只改 .env。"""
|
||||
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
def _split(value: str) -> list[str]:
|
||||
return [item.strip() for item in value.split(",") if item.strip()]
|
||||
|
||||
|
||||
# ---- LLM(DeepSeek 等,OpenAI 兼容) ----
|
||||
LLM_BASE_URL = os.getenv("LLM_BASE_URL", "https://api.deepseek.com/v1")
|
||||
LLM_API_KEY = os.getenv("LLM_API_KEY", "")
|
||||
LLM_MODEL = os.getenv("LLM_MODEL", "deepseek-chat")
|
||||
|
||||
# ---- STT(SenseVoice / FunASR,OpenAI 兼容) ----
|
||||
STT_BASE_URL = os.getenv("STT_BASE_URL", "http://localhost:8001/v1")
|
||||
STT_API_KEY = os.getenv("STT_API_KEY", "local")
|
||||
STT_MODEL = os.getenv("STT_MODEL", "sensevoice")
|
||||
|
||||
# ---- TTS(CosyVoice,OpenAI 兼容) ----
|
||||
TTS_BASE_URL = os.getenv("TTS_BASE_URL", "http://localhost:8002/v1")
|
||||
TTS_API_KEY = os.getenv("TTS_API_KEY", "local")
|
||||
TTS_MODEL = os.getenv("TTS_MODEL", "cosyvoice")
|
||||
TTS_VOICE = os.getenv("TTS_VOICE", "中文女")
|
||||
|
||||
# ---- Realtime(可选) ----
|
||||
REALTIME_API_KEY = os.getenv("REALTIME_API_KEY", "")
|
||||
REALTIME_MODEL = os.getenv("REALTIME_MODEL", "gpt-realtime")
|
||||
|
||||
# ---- 数据库(Postgres) ----
|
||||
DATABASE_URL = os.getenv(
|
||||
"DATABASE_URL",
|
||||
"postgresql+asyncpg://postgres:postgres@localhost:5432/postgres",
|
||||
)
|
||||
|
||||
# ---- 服务 ----
|
||||
HOST = os.getenv("HOST", "0.0.0.0")
|
||||
PORT = int(os.getenv("PORT", "8000"))
|
||||
CORS_ORIGINS = _split(os.getenv("CORS_ORIGINS", "http://localhost:3000"))
|
||||
Reference in New Issue
Block a user