4.8.1 test-fix (#1561)

This commit is contained in:
Archer
2024-05-22 18:49:39 +08:00
committed by GitHub
parent 87e4afe89b
commit b1aafde7c9
65 changed files with 1245 additions and 293 deletions

View File

@@ -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
}
];

View File

@@ -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);

View File

@@ -428,7 +428,7 @@ export const v1Workflow2V2 = (
pluginId,
pluginType: node.pluginType,
parentId: node.parentId,
version: 'v2.0',
version: '481',
inputs,
outputs

View File

@@ -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 */