feat: 增强模型配置与创建表单功能
- 在 NodeLibraryFormItem 和 WorkflowItem 接口中添加了新的字段,如 value、options、expand 和 outputParams,以支持更复杂的表单配置。 - 新增 getOperatorList 函数以获取服务商列表,并在 editModule.vue 中集成了运营商选择功能。 - 更新了模型创建和编辑逻辑,支持 tokenConfig 的 JSON 格式配置,确保更灵活的模型设置。 - 优化了文件上传处理,增加了上传状态管理,提升用户体验。
This commit is contained in:
@@ -12,6 +12,19 @@ export interface NodeLibraryFormItem {
|
||||
type: 'input' | 'number' | 'textarea' | 'switch' | string;
|
||||
required: boolean;
|
||||
default?: string | number | boolean;
|
||||
value?: unknown;
|
||||
options?: Array<{ label: string; value: string | number }> | null;
|
||||
expand?: NodeLibraryFormItem[] | Record<string, unknown> | null;
|
||||
fieldConstraint?: {
|
||||
fileTypes?: string;
|
||||
maxFileSize?: number;
|
||||
maxFileCount?: number;
|
||||
minLength?: number;
|
||||
maxLength?: number;
|
||||
numberType?: 'integer' | 'decimal' | string;
|
||||
minValue?: number;
|
||||
maxValue?: number;
|
||||
} | null;
|
||||
}
|
||||
|
||||
export interface NodeLibraryModelConfig {
|
||||
@@ -188,6 +201,11 @@ export interface WorkflowItem {
|
||||
description: string;
|
||||
flowContent: any;
|
||||
nodeInputParams?: any[];
|
||||
outputParams?: Array<Record<string, string>>;
|
||||
imgAddressPrefix?: string;
|
||||
fileUrls?: string[];
|
||||
resultUrl?: string;
|
||||
sessionId?: string;
|
||||
}
|
||||
|
||||
export interface WorkflowListResponse {
|
||||
@@ -313,6 +331,7 @@ export interface ExecuteFlowParams {
|
||||
nodeInputParams?: FlowNode[];
|
||||
sessionId?: string;
|
||||
skillName?: string;
|
||||
resultUrl?: string;
|
||||
}
|
||||
|
||||
export function executeFlow(data: ExecuteFlowParams | FormData, requestOptions?: RequestOptions) {
|
||||
|
||||
@@ -235,3 +235,13 @@ export function getIsChatModel() {
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务商列表
|
||||
*/
|
||||
export function getOperatorList() {
|
||||
return request({
|
||||
url: '/model-gateway/model/listOperator',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user