更新模型配置,新增字段支持和请求映射功能,优化界面元素,移除冗余代码
This commit is contained in:
@@ -444,10 +444,13 @@ const handleCreatePrivateModel = async () => {
|
||||
isPrivate: builtInModel.isPrivate ?? 1,
|
||||
enabled: builtInModel.enabled ?? 1,
|
||||
isChatModel: builtInModel.isChatModel || 0,
|
||||
isAsync: builtInModel.isAsync ?? 0,
|
||||
callMode: builtInModel.callMode ?? builtInModel.isAsync ?? 0,
|
||||
apiKey: apiKeyForm.apiKey,
|
||||
form: formList,
|
||||
requestMapping: (builtInModel.requestMapping as Record<string, unknown>) || {},
|
||||
requiredFields: Array.isArray(builtInModel.requiredFields) ? builtInModel.requiredFields : [],
|
||||
firstFrame: String(builtInModel.firstFrame || ''),
|
||||
lastFrame: String(builtInModel.lastFrame || ''),
|
||||
responseMapping: (builtInModel.responseMapping as Record<string, unknown>) || {},
|
||||
responseBody: builtInModel.responseBody || {},
|
||||
maxConcurrency: builtInModel.maxConcurrency || 10,
|
||||
@@ -457,8 +460,6 @@ const handleCreatePrivateModel = async () => {
|
||||
retryTimes: builtInModel.retryTimes || 3,
|
||||
retryQueueMaxSeconds: builtInModel.retryQueueMaxSeconds || 60,
|
||||
autoCleanSeconds: builtInModel.autoCleanSeconds || 300,
|
||||
remark: builtInModel.remark || '',
|
||||
|
||||
extendMapping: fieldsToUnknownObject(
|
||||
Object.entries(parseJsonObjectField(builtInModel.extendMapping)).map(([k, v]) => ({ key: k, value: String(v ?? '') }))
|
||||
),
|
||||
@@ -470,6 +471,10 @@ const handleCreatePrivateModel = async () => {
|
||||
? (builtInModel.queryConfig as Record<string, unknown>)
|
||||
: null
|
||||
),
|
||||
streamConfig:
|
||||
builtInModel.streamConfig && typeof builtInModel.streamConfig === 'object' && !Array.isArray(builtInModel.streamConfig)
|
||||
? (builtInModel.streamConfig as Record<string, unknown>)
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const res: any = await addModelModule(createParams);
|
||||
|
||||
Reference in New Issue
Block a user