feat(upstream): custom 模型按媒体分类配置参考文件上限
- ModelConfig 新增 max_reference_videos / max_reference_audios (配合既有 max_reference_images);admin 读写接口透传 - custom 模型表单去掉「参考模式」下拉,改为参考图/参考视频/ 参考音频三个数量输入;合计张数走 totalRefLimit 校验 - vivid 上游 /v1/uploads 按文件魔数自动选 kind(image/video/ audio)与 mime;openai 协议上游遇视频/音频参考自动跳过换号 - videoCaps 让 custom 模型的分类上限在画图台/文档徽标生效 - reference_mode 请求级 override 放行 "media" Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -95,7 +95,7 @@ type EventLog struct {
|
||||
Duration string `gorm:"size:32"`
|
||||
Refs int `gorm:"not null;default:0"`
|
||||
DeAI bool `gorm:"not null;default:false"` // 去AI特征 was applied (image only)
|
||||
RefFiles datatypes.JSON `gorm:"type:jsonb"` // relative paths of saved reference images, for回显 on reload
|
||||
RefFiles datatypes.JSON `gorm:"type:jsonb"` // relative paths of saved reference images, for回显 on reload
|
||||
Source string `gorm:"size:32;index"`
|
||||
// AccountID is the provider token/account chosen to fulfil this generation,
|
||||
// stamped when the upstream call begins. Drives the accounts view's live
|
||||
@@ -139,7 +139,11 @@ type ModelConfig struct {
|
||||
DurationPricesAgent datatypes.JSONMap `gorm:"type:jsonb;column:duration_prices_agent"`
|
||||
Durations datatypes.JSON `gorm:"type:jsonb"`
|
||||
MaxReferenceImages int `gorm:"not null;default:0"`
|
||||
ReferenceMode string `gorm:"size:32;not null;default:'none'"`
|
||||
// Per-kind reference caps for upstreams that accept video/audio refs
|
||||
// (vivid-protocol custom upstreams). 0 = that kind is not accepted.
|
||||
MaxReferenceVideos int `gorm:"not null;default:0"`
|
||||
MaxReferenceAudios int `gorm:"not null;default:0"`
|
||||
ReferenceMode string `gorm:"size:32;not null;default:'none'"`
|
||||
// Custom-upstream models (provider="custom"): UpstreamModel is the model name
|
||||
// sent to the upstream OpenAI-compatible API; the base_url + key live on the
|
||||
// matching custom account (pool="custom", meta.base_url). Empty for built-ins.
|
||||
@@ -263,15 +267,15 @@ func AutoMigrateModels() []any {
|
||||
type Order struct {
|
||||
ID string `gorm:"primaryKey;size:40"`
|
||||
UserID string `gorm:"size:32;index;not null"`
|
||||
Amount float64 `gorm:"not null"` // 充值金额(元)
|
||||
Points int `gorm:"not null"` // 到账积分
|
||||
PayType string `gorm:"size:16"` // wxpay | alipay | admin | cdk
|
||||
Status string `gorm:"size:16;index;not null"` // pending | paid | cancelled
|
||||
Amount float64 `gorm:"not null"` // 充值金额(元)
|
||||
Points int `gorm:"not null"` // 到账积分
|
||||
PayType string `gorm:"size:16"` // wxpay | alipay | admin | cdk
|
||||
Status string `gorm:"size:16;index;not null"` // pending | paid | cancelled
|
||||
Source string `gorm:"size:16;index;not null;default:'epay'"` // epay | admin | cdk
|
||||
Remark string `gorm:"type:text"` // e.g. 兑换码 code / 管理员操作说明
|
||||
TradeNo string `gorm:"size:64;index"` // 易支付平台订单号
|
||||
PayInfo string `gorm:"type:text"` // 二维码 url / 跳转 url
|
||||
PayInfoType string `gorm:"size:16"` // qrcode | jump | html | ...
|
||||
Remark string `gorm:"type:text"` // e.g. 兑换码 code / 管理员操作说明
|
||||
TradeNo string `gorm:"size:64;index"` // 易支付平台订单号
|
||||
PayInfo string `gorm:"type:text"` // 二维码 url / 跳转 url
|
||||
PayInfoType string `gorm:"size:16"` // qrcode | jump | html | ...
|
||||
ExpiresAt time.Time `gorm:"index"`
|
||||
PaidAt *time.Time
|
||||
CreatedAt time.Time
|
||||
@@ -294,10 +298,10 @@ type ConcurrencyGroup struct {
|
||||
// node/edge graph as a versioned JSON blob; saves are whole-document
|
||||
// replacements (last write wins), which matches the single-editor frontend.
|
||||
type Canvas struct {
|
||||
ID string `gorm:"primaryKey;size:40"`
|
||||
UserID string `gorm:"size:32;index;not null"`
|
||||
Title string `gorm:"size:120;not null;default:'未命名画布'"`
|
||||
Data string `gorm:"type:text"`
|
||||
ID string `gorm:"primaryKey;size:40"`
|
||||
UserID string `gorm:"size:32;index;not null"`
|
||||
Title string `gorm:"size:120;not null;default:'未命名画布'"`
|
||||
Data string `gorm:"type:text"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time `gorm:"index"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user