feat: 增强模型配置与创建表单功能
- 在 NodeLibraryFormItem 和 WorkflowItem 接口中添加了新的字段,如 value、options、expand 和 outputParams,以支持更复杂的表单配置。 - 新增 getOperatorList 函数以获取服务商列表,并在 editModule.vue 中集成了运营商选择功能。 - 更新了模型创建和编辑逻辑,支持 tokenConfig 的 JSON 格式配置,确保更灵活的模型设置。 - 优化了文件上传处理,增加了上传状态管理,提升用户体验。
This commit is contained in:
@@ -186,13 +186,23 @@ const checkAdminStatus = async () => {
|
||||
};
|
||||
|
||||
// 判断是否为推理模型(只有推理模型才能设置为会话模型)
|
||||
const normalizeModelTypeKey = (modelType: number | string | undefined | null) => {
|
||||
if (modelType === undefined || modelType === null || modelType === '') {
|
||||
return '';
|
||||
}
|
||||
const raw = String(modelType).trim();
|
||||
const n = Number(raw);
|
||||
return Number.isNaN(n) ? raw : String(n);
|
||||
};
|
||||
|
||||
const isInferenceModel = (modelType: number | string | undefined | null) => {
|
||||
if (modelType === undefined || modelType === null || modelType === '') {
|
||||
return false;
|
||||
}
|
||||
// 查找模型类型标签,判断是否为"推理模型"
|
||||
const typeInfo = state.modelTypes.find((t) => String(t.id) === String(modelType));
|
||||
return typeInfo?.label === '推理模型' || String(modelType) === '1';
|
||||
const modelTypeKey = normalizeModelTypeKey(modelType);
|
||||
const typeInfo = state.modelTypes.find((t) => normalizeModelTypeKey(t.id) === modelTypeKey);
|
||||
return typeInfo?.label === '推理模型' || modelTypeKey === '1' || modelTypeKey === '100';
|
||||
};
|
||||
|
||||
// 设置为会话模型
|
||||
@@ -278,7 +288,8 @@ const resolveModelTypeLabel = (modelType: number | string | undefined | null) =>
|
||||
if (modelType === undefined || modelType === null || modelType === '') {
|
||||
return '—';
|
||||
}
|
||||
const hit = state.modelTypes.find((t) => String(t.id) === String(modelType));
|
||||
const modelTypeKey = normalizeModelTypeKey(modelType);
|
||||
const hit = state.modelTypes.find((t) => normalizeModelTypeKey(t.id) === modelTypeKey);
|
||||
return hit?.label ?? String(modelType);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user