feat: 新增统一模型网关与模型管理工作区
- 新增 OpenAI 兼容统一模型调用链路、模型发布配置与批量发布能力 - 重构模型管理页面入口与统一网关工作区,更新服务商 logo 资源与模型 ID 文案 - 收口全新库初始化脚本,仅保留服务商种子并整理统一网关 migration
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import {getProviderBadgeText, getProviderPresetByValue} from '../defaultIcon';
|
||||
import { getProviderBadgeText, getProviderPresetByValue } from '../defaultIcon';
|
||||
|
||||
describe('defaultIcon helpers', () => {
|
||||
it('使用 lobehub 官方静态 svg 作为默认服务商 logo', () => {
|
||||
expect(getProviderPresetByValue('openai')?.icon).toBe(
|
||||
'/model-providers/lobehub/openai.svg',
|
||||
);
|
||||
expect(getProviderPresetByValue('deepseek')?.icon).toBe(
|
||||
'/model-providers/lobehub/deepseek.svg',
|
||||
);
|
||||
expect(getProviderPresetByValue('self-hosted')?.icon).toBe(
|
||||
'/model-providers/lobehub/vllm.svg',
|
||||
);
|
||||
});
|
||||
|
||||
it('可以读取新的服务商预设', () => {
|
||||
const preset = getProviderPresetByValue('self-hosted');
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import { $t } from '#/locales';
|
||||
|
||||
export type BooleanField =
|
||||
| 'supportAudio'
|
||||
| 'supportFree'
|
||||
| 'supportImage'
|
||||
| 'supportImageB64Only'
|
||||
| 'supportThinking'
|
||||
@@ -56,14 +55,6 @@ export const getDefaultModelAbility = (): ModelAbilityItem[] => [
|
||||
selected: false,
|
||||
field: 'supportImage',
|
||||
},
|
||||
{
|
||||
label: $t('llm.modelAbility.supportFree'),
|
||||
value: 'free',
|
||||
defaultType: 'info',
|
||||
activeType: 'success',
|
||||
selected: false,
|
||||
field: 'supportFree',
|
||||
},
|
||||
{
|
||||
label: $t('llm.modelAbility.supportAudio'),
|
||||
value: 'audio',
|
||||
@@ -126,7 +117,6 @@ export const syncTagSelectedStatus = (
|
||||
|
||||
/**
|
||||
* 处理标签点击事件
|
||||
* @param modelAbility 模型能力数组
|
||||
* @param item 被点击的标签项
|
||||
* @param formData 表单数据对象
|
||||
*/
|
||||
@@ -165,5 +155,4 @@ export const getAllBooleanFields = (): BooleanField[] => [
|
||||
'supportImageB64Only',
|
||||
'supportVideo',
|
||||
'supportAudio',
|
||||
'supportFree',
|
||||
];
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/deepseek.png"
|
||||
"icon": "/model-providers/lobehub/deepseek.svg"
|
||||
},
|
||||
{
|
||||
"label": "OpenAI",
|
||||
@@ -62,7 +62,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/openai.svg"
|
||||
"icon": "/model-providers/lobehub/openai.svg"
|
||||
},
|
||||
{
|
||||
"label": "阿里百炼",
|
||||
@@ -98,7 +98,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/aliyun.png"
|
||||
"icon": "/model-providers/lobehub/bailian.svg"
|
||||
},
|
||||
{
|
||||
"label": "智谱",
|
||||
@@ -133,7 +133,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/zhipu.png"
|
||||
"icon": "/model-providers/lobehub/zhipu.svg"
|
||||
},
|
||||
{
|
||||
"label": "MiniMax",
|
||||
@@ -161,7 +161,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/minimax.png"
|
||||
"icon": "/model-providers/lobehub/minimax.svg"
|
||||
},
|
||||
{
|
||||
"label": "Kimi",
|
||||
@@ -189,7 +189,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/kimi.png"
|
||||
"icon": "/model-providers/lobehub/kimi.svg"
|
||||
},
|
||||
{
|
||||
"label": "硅基流动",
|
||||
@@ -225,7 +225,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/siliconflow.png"
|
||||
"icon": "/model-providers/lobehub/siliconcloud.svg"
|
||||
},
|
||||
{
|
||||
"label": "Ollama",
|
||||
@@ -253,7 +253,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/ollama.png"
|
||||
"icon": "/model-providers/lobehub/ollama.svg"
|
||||
},
|
||||
{
|
||||
"label": "自部署",
|
||||
@@ -288,6 +288,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"icon": "/model-providers/self-hosted.svg"
|
||||
"icon": "/model-providers/lobehub/vllm.svg"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user