mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 05:19:51 +00:00
4.8.1 test-fix (#1561)
This commit is contained in:
@@ -701,6 +701,7 @@ export const getSystemVariables = (t: TFunction): EditorVariablePickerType[] =>
|
||||
{
|
||||
key: 'appId',
|
||||
label: t('core.module.http.AppId'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
@@ -716,11 +717,13 @@ export const getSystemVariables = (t: TFunction): EditorVariablePickerType[] =>
|
||||
{
|
||||
key: 'histories',
|
||||
label: t('core.module.http.Histories'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.chatHistory
|
||||
},
|
||||
{
|
||||
key: 'cTime',
|
||||
label: t('core.module.http.Current time'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
}
|
||||
];
|
||||
|
@@ -26,10 +26,11 @@ export const getCountChatInputGuideTotal = (data: countChatInputGuideTotalQuery)
|
||||
export const getChatInputGuideList = (data: ChatInputGuideProps) =>
|
||||
GET<ChatInputGuideResponse>(`/core/chat/inputGuide/list`, data);
|
||||
|
||||
export const queryChatInputGuideList = (
|
||||
data: QueryChatInputGuideProps,
|
||||
url = `/core/chat/inputGuide/query`
|
||||
) => GET<QueryChatInputGuideResponse>(url, data);
|
||||
export const queryChatInputGuideList = (data: QueryChatInputGuideProps, url?: string) => {
|
||||
return GET<QueryChatInputGuideResponse>(url ?? `/core/chat/inputGuide/query`, data, {
|
||||
withCredentials: !url
|
||||
});
|
||||
};
|
||||
|
||||
export const postChatInputGuides = (data: createInputGuideBody) =>
|
||||
POST<createInputGuideResponse>(`/core/chat/inputGuide/create`, data);
|
||||
|
@@ -428,7 +428,7 @@ export const v1Workflow2V2 = (
|
||||
pluginId,
|
||||
pluginType: node.pluginType,
|
||||
parentId: node.parentId,
|
||||
version: 'v2.0',
|
||||
version: '481',
|
||||
|
||||
inputs,
|
||||
outputs
|
||||
|
@@ -157,7 +157,7 @@ export const computedNodeInputReference = ({
|
||||
|
||||
return sourceNodes;
|
||||
};
|
||||
export const getReferenceDataValueType = ({
|
||||
export const getRefData = ({
|
||||
variable,
|
||||
nodeList,
|
||||
chatConfig,
|
||||
@@ -168,16 +168,34 @@ export const getReferenceDataValueType = ({
|
||||
chatConfig: AppChatConfigType;
|
||||
t: TFunction;
|
||||
}) => {
|
||||
if (!variable) return WorkflowIOValueTypeEnum.any;
|
||||
if (!variable)
|
||||
return {
|
||||
valueType: WorkflowIOValueTypeEnum.any,
|
||||
required: false
|
||||
};
|
||||
|
||||
const node = nodeList.find((node) => node.nodeId === variable[0]);
|
||||
const systemVariables = getWorkflowGlobalVariables({ nodes: nodeList, chatConfig, t });
|
||||
|
||||
if (!node) return systemVariables.find((item) => item.key === variable?.[1])?.valueType;
|
||||
if (!node) {
|
||||
const globalVariable = systemVariables.find((item) => item.key === variable?.[1]);
|
||||
return {
|
||||
valueType: globalVariable?.valueType || WorkflowIOValueTypeEnum.any,
|
||||
required: !!globalVariable?.required
|
||||
};
|
||||
}
|
||||
|
||||
const output = node.outputs.find((item) => item.id === variable[1]);
|
||||
if (!output) return WorkflowIOValueTypeEnum.any;
|
||||
return output.valueType;
|
||||
if (!output)
|
||||
return {
|
||||
valueType: WorkflowIOValueTypeEnum.any,
|
||||
required: false
|
||||
};
|
||||
|
||||
return {
|
||||
valueType: output.valueType,
|
||||
required: !!output.required
|
||||
};
|
||||
};
|
||||
|
||||
/* Connection rules */
|
||||
|
Reference in New Issue
Block a user