mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
perf: http body;perf: create by json;perf: create by curl (#3570)
* perf: http body * feat: create app by json (#3557) * feat: create app by json * fix build * perf: create by json;perf: create by curl * fix: ts --------- Co-authored-by: heheer <heheer@sealos.io>
This commit is contained in:
@@ -5,6 +5,8 @@ import type { FlowNodeInputItemType } from '../workflow/type/io.d';
|
||||
import { getAppChatConfig } from '../workflow/utils';
|
||||
import { StoreNodeItemType } from '../workflow/type/node';
|
||||
import { DatasetSearchModeEnum } from '../dataset/constants';
|
||||
import { WorkflowTemplateBasicType } from '../workflow/type';
|
||||
import { AppTypeEnum } from './constants';
|
||||
|
||||
export const getDefaultAppForm = (): AppSimpleEditFormType => {
|
||||
return {
|
||||
@@ -127,3 +129,20 @@ export const appWorkflow2Form = ({
|
||||
|
||||
return defaultAppForm;
|
||||
};
|
||||
|
||||
export const getAppType = (config?: WorkflowTemplateBasicType | AppSimpleEditFormType) => {
|
||||
if (!config) return '';
|
||||
|
||||
if ('aiSettings' in config) {
|
||||
return AppTypeEnum.simple;
|
||||
}
|
||||
|
||||
if (!('nodes' in config)) return '';
|
||||
if (config.nodes.some((node) => node.flowNodeType === 'workflowStart')) {
|
||||
return AppTypeEnum.workflow;
|
||||
}
|
||||
if (config.nodes.some((node) => node.flowNodeType === 'pluginInput')) {
|
||||
return AppTypeEnum.plugin;
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
Reference in New Issue
Block a user