4.8.13 test (#3098)

* perf: loop node refresh

* rename context

* comment

* fix: ts

* perf: push chat log
This commit is contained in:
Archer
2024-11-08 16:02:33 +08:00
committed by archer
parent 0a238845ab
commit c5022654ca
36 changed files with 303 additions and 221 deletions

View File

@@ -25,7 +25,7 @@ export const dispatchLoop = async (props: Props): Promise<Response> => {
user,
node: { name }
} = props;
const { loopInputArray = [], childrenNodeIdList } = params;
const { loopInputArray = [], childrenNodeIdList = [] } = params;
if (!Array.isArray(loopInputArray)) {
return Promise.reject('Input value is not an array');

View File

@@ -11,7 +11,7 @@ import {
import { TUpdateListItem } from '@fastgpt/global/core/workflow/template/system/variableUpdate/type';
import { ModuleDispatchProps } from '@fastgpt/global/core/workflow/runtime/type';
import { removeSystemVariable, valueTypeFormat } from '../utils';
import { isReferenceValue } from '@fastgpt/global/core/workflow/utils';
import { isValidReferenceValue } from '@fastgpt/global/core/workflow/utils';
type Props = ModuleDispatchProps<{
[NodeInputKeyEnum.updateList]: TUpdateListItem[];
@@ -27,13 +27,17 @@ export const dispatchUpdateVariable = async (props: Props): Promise<Response> =>
const result = updateList.map((item) => {
const variable = item.variable;
if (!isReferenceValue(variable, nodeIds)) {
if (!isValidReferenceValue(variable, nodeIds)) {
return null;
}
const varNodeId = variable[0];
const varKey = variable[1];
if (!varKey) {
return null;
}
const value = (() => {
// If first item is empty, it means it is a input value
if (!item.value?.[0]) {