feat(model):新增MiniMax-H3视频支持
This commit is contained in:
1 parent
26c53c2228
commit
5ce16daa46
29 files changed
+3736
-98
No files matched your search
@@ -0,0 +1,61 @@
|
||||
// 模型研发厂商共享常量(管理后台模型管理列表/筛选/表单共用)
|
||||
// value 与后端 mdl_models.vendor 枚举一一对应(api/admin/v1/model.go 的 v:"in:" 校验、
|
||||
// internal/logic/admin/model.go 的 validModelVendors)。
|
||||
// 新增厂商时需同步:后端枚举校验、租户端 web/tenant/src/constants/vendor.ts、本文件。
|
||||
// 注意与渠道供应商类型(constants/channel.ts,chn_channels.type)是两个维度:厂商 = 模型的研发公司,
|
||||
// 例如 Bedrock 上的 Claude 厂商仍是 anthropic。
|
||||
|
||||
export const vendorOptions: { label: string; value: string }[] = [
|
||||
{ label: 'OpenAI', value: 'openai' },
|
||||
{ label: 'Anthropic', value: 'anthropic' },
|
||||
{ label: 'Google', value: 'google' },
|
||||
{ label: 'xAI', value: 'xai' },
|
||||
{ label: 'Mistral', value: 'mistral' },
|
||||
{ label: 'Cohere', value: 'cohere' },
|
||||
{ label: 'Meta', value: 'meta' },
|
||||
{ label: '阿里巴巴', value: 'alibaba' },
|
||||
{ label: '字节跳动', value: 'bytedance' },
|
||||
{ label: '深度求索', value: 'deepseek' },
|
||||
{ label: '智谱AI', value: 'zhipu' },
|
||||
{ label: '月之暗面', value: 'moonshot' },
|
||||
{ label: 'MiniMax', value: 'minimax' },
|
||||
{ label: '百度', value: 'baidu' },
|
||||
{ label: '腾讯', value: 'tencent' },
|
||||
{ label: '科大讯飞', value: 'xunfei' },
|
||||
{ label: '快手', value: 'kuaishou' },
|
||||
{ label: 'Midjourney', value: 'midjourney' },
|
||||
{ label: 'Suno', value: 'suno' },
|
||||
]
|
||||
|
||||
// value -> label 映射,表格列展示用
|
||||
export const vendorLabelMap: Record<string, string> = {}
|
||||
vendorOptions.forEach(o => { vendorLabelMap[o.value] = o.label })
|
||||
|
||||
// value -> Arco Tag 预设色映射(淡底深字,取接近品牌色的预设)
|
||||
export const vendorTagColor: Record<string, string> = {
|
||||
openai: 'green',
|
||||
anthropic: 'orange',
|
||||
google: 'arcoblue',
|
||||
xai: 'gray',
|
||||
mistral: 'orangered',
|
||||
cohere: 'cyan',
|
||||
meta: 'blue',
|
||||
alibaba: 'purple', // 图标用通义千问 mark(品牌紫),Tag 色随之取紫
|
||||
bytedance: 'arcoblue',
|
||||
deepseek: 'blue',
|
||||
zhipu: 'purple',
|
||||
moonshot: 'gray',
|
||||
minimax: 'red',
|
||||
baidu: 'blue',
|
||||
tencent: 'cyan',
|
||||
xunfei: 'arcoblue',
|
||||
kuaishou: 'orangered',
|
||||
midjourney: 'gray',
|
||||
suno: 'purple',
|
||||
}
|
||||
|
||||
// Arco Select 的 allow-search 自定义过滤:小写包含匹配
|
||||
export function filterVendorOption(inputValue: string, option: { label: string; value: string }) {
|
||||
const input = inputValue.toLowerCase()
|
||||
return option.label.toLowerCase().includes(input)
|
||||
}
|
||||
@@ -162,6 +162,7 @@ const pricingModeTagColor: Record<string, string> = {
|
||||
token: 'arcoblue',
|
||||
per_request: 'orangered',
|
||||
tiered: 'purple',
|
||||
per_second: 'green',
|
||||
}
|
||||
|
||||
// ===== 移动端卡片自定义布局用的格式化(仅用于卡片插槽,不改动桌面端列 render)=====
|
||||
@@ -177,18 +178,29 @@ function formatTokens(n: number | null | undefined): string {
|
||||
return String(n)
|
||||
}
|
||||
|
||||
// 定价主文本:本位币 输入/输出、单价/次、未定价(bil 层定价直显)
|
||||
// 按秒模式基准单价:优先 "*" 兜底价,否则取矩阵最小正价(与定价弹窗 perSecondBasePrice 口径一致)
|
||||
function perSecondBasePrice(row: any): number {
|
||||
const prices = Object.values(row.per_second_prices || {}).map((p) => Number(p) || 0).filter((p) => p > 0)
|
||||
if (prices.length === 0) return 0
|
||||
const wildcard = Number(row.per_second_prices?.['*']) || 0
|
||||
return wildcard > 0 ? wildcard : Math.min(...prices)
|
||||
}
|
||||
|
||||
// 定价主文本:本位币 输入/输出、单价/次、单价/秒、未定价(bil 层定价直显)
|
||||
function pricingMain(row: any): string {
|
||||
if (!row.pricing_mode) return '未定价'
|
||||
if (row.pricing_mode === 'per_request') {
|
||||
return `${formatBilling(row.per_request_price ?? 0, 4)}/次`
|
||||
}
|
||||
if (row.pricing_mode === 'per_second') {
|
||||
return `${formatBilling(perSecondBasePrice(row), 4)}/秒`
|
||||
}
|
||||
return `${formatBilling(row.input_price ?? 0, 2)}/${formatBilling(row.output_price ?? 0, 2)}`
|
||||
}
|
||||
|
||||
// 定价模式副文本:按量 / 按次 / 阶梯(未定价返回空串)
|
||||
// 定价模式副文本:按量 / 按次 / 阶梯 / 按秒(未定价返回空串)
|
||||
function pricingMode(row: any): string {
|
||||
const m: Record<string, string> = { token: '按量', per_request: '按次', tiered: '阶梯' }
|
||||
const m: Record<string, string> = { token: '按量', per_request: '按次', tiered: '阶梯', per_second: '按秒' }
|
||||
return row.pricing_mode ? (m[row.pricing_mode] || row.pricing_mode) : ''
|
||||
}
|
||||
|
||||
@@ -237,13 +249,16 @@ const columns: TableColumnData[] = [
|
||||
if (!record.pricing_mode) {
|
||||
return h(Tag, { color: 'orangered', size: 'small' }, () => '未定价')
|
||||
}
|
||||
const modeLabel: Record<string, string> = { token: '按量', per_request: '按次', tiered: '阶梯' }
|
||||
const modeLabel: Record<string, string> = { token: '按量', per_request: '按次', tiered: '阶梯', per_second: '按秒' }
|
||||
const tags = [
|
||||
h(Tag, { color: pricingModeTagColor[record.pricing_mode] || 'gray', size: 'small' }, () => modeLabel[record.pricing_mode] || record.pricing_mode),
|
||||
]
|
||||
if (record.pricing_mode === 'per_request') {
|
||||
tags.push(h('span', { style: 'font-size: 12px; color: var(--color-text-3); margin-left: 4px;' },
|
||||
`${formatBilling(record.per_request_price ?? 0, 4)}/次`))
|
||||
} else if (record.pricing_mode === 'per_second') {
|
||||
tags.push(h('span', { style: 'font-size: 12px; color: var(--color-text-3); margin-left: 4px;' },
|
||||
`${formatBilling(perSecondBasePrice(record), 4)}/秒`))
|
||||
} else {
|
||||
tags.push(h('span', { style: 'font-size: 12px; color: var(--color-text-3); margin-left: 4px;' },
|
||||
`${formatBilling(record.input_price ?? 0, 2)}/${formatBilling(record.output_price ?? 0, 2)}`))
|
||||
|
||||
@@ -49,6 +49,7 @@ const platformOptions = [
|
||||
{ label: 'Suno', value: 'suno' },
|
||||
{ label: '火山引擎', value: 'volcengine' },
|
||||
{ label: '阿里', value: 'ali' },
|
||||
{ label: 'MiniMax', value: 'minimax' },
|
||||
]
|
||||
|
||||
const statusTagColor: Record<string, string | undefined> = {
|
||||
@@ -74,6 +75,7 @@ const platformLabel: Record<string, string> = {
|
||||
suno: 'Suno',
|
||||
volcengine: '火山引擎',
|
||||
ali: '阿里',
|
||||
minimax: 'MiniMax',
|
||||
}
|
||||
|
||||
const columns: TableColumnData[] = [
|
||||
|
||||
Reference in new issue
Block a user