Files
ttstd-infinite-canvas/.env.example
dingxin150015-commits ea236b5956 feat(provider): add plugin system for service-specific model discovery
Model discovery currently assumes every provider exposes all models via
GET {baseURL}/models. Providers like Alibaba Cloud Bailian serve video,
3D and some image models through dedicated endpoints, so 21 models across
5 families (HappyHorse / Wan / Kling / PixVerse / Vidu / Tripo) are never
discoverable - a functional blocker for a video creation workbench.

This introduces a ModelDiscovery plugin interface with a registry that
matches vendor plugins by base URL and falls back to the standard OpenAI
implementation, keeping core discovery logic vendor-agnostic.

- add provider.ModelDiscovery interface and plugin registry
- add openai plugin (standard behaviour, default fallback)
- add bailian plugin (standard + 21 extended multimodal models)
- gate behind ENABLE_PROVIDER_PLUGINS, default false
- register plugins lazily from service layer to avoid import cycle

Verified locally: flag off -> 238 models (unchanged); flag on -> 257
models (238 + 19 net new after dedup). OpenAI and Gemini channels
unaffected in both modes.
2026-08-17 13:47:27 +08:00

27 lines
1.4 KiB
Plaintext
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.
# 本文件只声明可公开的运行配置,不要在这里填写任何密钥。
CANVAS_REGISTRATION_ENABLED=false
# 默认拒绝后端访问本机和私网;可信私网或 HTTP 服务按主机精确放行,不要填写协议、端口或路径。
CANVAS_ALLOW_PRIVATE_UPSTREAMS=false
# 多个主机使用英文逗号分隔,例如:gateway.internal,192.168.1.10
CANVAS_ALLOWED_PRIVATE_UPSTREAM_HOSTS=
# “允许本机渠道”是独立的桌面部署能力,默认关闭;只有后端实际绑定 127.0.0.1 时 true 才会生效。
CANVAS_DESKTOP_LOCAL_CHANNELS_ENABLED=false
# 桌面本机渠道启用时必须显式使用:CANVAS_BACKEND_ADDR=127.0.0.1:8080
CANVAS_CORS_ORIGINS=http://localhost:3000
# 启用服务商插件系统以支持特定服务的模型发现(如阿里云百炼的视频生成模型)
# 设置为 true 启用插件机制,false 使用传统方式(默认:false)
ENABLE_PROVIDER_PLUGINS=false
CANVAS_DATA_PATH=./data
CANVAS_WORKER_CONCURRENCY=3
CANVAS_CHANNEL_CONCURRENCY=3
# 新服务器请直接运行 README 的一键部署命令;脚本会在 .env 中生成以下 PostgreSQL 配置。
# POSTGRES_DB=open_ai_canvas
# POSTGRES_USER=open_ai_canvas
# POSTGRES_PASSWORD=由部署脚本随机生成
# DATABASE_URL=postgresql://open_ai_canvas:随机密码@postgres:5432/open_ai_canvas?sslmode=disable
# REDIS_URL=redis://redis:6379/0
# CANVAS_POSTGRES_DATA_PATH=./postgres-data
# CANVAS_REDIS_DATA_PATH=./redis-data
# CANVAS_HTTP_PORT=3000