- Added support for public Realtime API, including new routes for managing API keys and handling WebRTC connections. - Introduced RealtimeApiKey model and associated CRUD operations for admin management of API keys. - Implemented authentication mechanisms for API keys and client secrets. - Enhanced environment configuration with new secrets for Realtime API. - Created OpenAIRealtime session management and event processing for real-time interactions. - Updated schemas and settings to accommodate new features and ensure compatibility with existing systems.
39 lines
1.7 KiB
Plaintext
39 lines
1.7 KiB
Plaintext
# 复制为 .env 并填入真实值。
|
||
# 模型接入配置不再放在 .env;请在 model_resources 中维护 apiUrl/modelId/apiKey 等字段。
|
||
# 开发环境可先执行 `make db-seed`,再到前端「组件 / 模型」里替换真实密钥。
|
||
|
||
# ---- 数据库(Postgres) ----
|
||
# 本地直连;docker compose 里则用 postgres:5432
|
||
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
|
||
|
||
# ---- 服务监听 & 跨域 ----
|
||
HOST=0.0.0.0
|
||
PORT=8000
|
||
# NLTK 3.9+ import guard vs local .venv under backend/ (set in app.py by default; override here if needed)
|
||
# NLTK_DISABLE_IMPORT_SECURITY=1
|
||
# 前端开发地址,允许跨域(公网部署时加上实际前端 origin)
|
||
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
|
||
|
||
# ---- OpenAI-compatible Realtime API ----
|
||
# 用独立随机值签名长期 API Key 摘要和短期 Client Secret;生产环境必须修改。
|
||
REALTIME_TOKEN_SECRET=replace-with-a-long-random-secret
|
||
REALTIME_CLIENT_SECRET_TTL_SECONDS=60
|
||
|
||
# ---- RustFS / S3-compatible storage ----
|
||
# Use 127.0.0.1 (not localhost) if HTTP_PROXY is set — proxies often return 502 for localhost.
|
||
S3_ENDPOINT_URL=http://127.0.0.1:9000
|
||
S3_ACCESS_KEY=rustfsadmin
|
||
S3_SECRET_KEY=rustfsadmin
|
||
S3_BUCKET=ai-video
|
||
S3_REGION=us-east-1
|
||
KNOWLEDGE_MAX_FILE_BYTES=20971520
|
||
KNOWLEDGE_TOP_K=5
|
||
|
||
# ---- WebRTC TURN(公网跨网语音预览;本地开发留空) ----
|
||
# 与 docker compose --profile remote 的 coturn 配套。云安全组需放行 UDP 3478 与 49152-49200。
|
||
# Docker Compose 部署请在项目根 .env 设置这些变量;此处适用于宿主机直接运行 uvicorn。
|
||
# STUN_URL=stun:118.89.89.89:3478
|
||
# TURN_URLS=turn:118.89.89.89:3478?transport=udp,turn:118.89.89.89:3478?transport=tcp
|
||
# TURN_SECRET=your-turn-secret
|
||
# TURN_CREDENTIAL_TTL=86400
|