fix: plugin run & setting quote variables (#2150)

* fix

* fix

* change variables & variablelabels show condition

* fix type

* fix
This commit is contained in:
heheer
2024-07-25 18:01:43 +08:00
committed by GitHub
parent 55cefccad1
commit 5906daff9f
12 changed files with 89 additions and 51 deletions

View File

@@ -54,7 +54,10 @@ import { NextAPI } from '@/service/middleware/entry';
import { getAppLatestVersion } from '@fastgpt/service/core/app/controller';
import { ReadPermissionVal } from '@fastgpt/global/support/permission/constant';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { updatePluginInputByVariables } from '@fastgpt/global/core/workflow/utils';
import {
filterPluginInputVariables,
updatePluginInputByVariables
} from '@fastgpt/global/core/workflow/utils';
import { getNanoid } from '@fastgpt/global/common/string/tools';
import {
getPluginInputsFromStoreNodes,
@@ -235,6 +238,11 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
)
: storeNodes2RuntimeNodes(nodes, getDefaultEntryNodeIds(nodes));
const runtimeVariables = filterPluginInputVariables(
variables,
storeNodes2RuntimeNodes(nodes, getDefaultEntryNodeIds(nodes))
);
/* start flow controller */
const { flowResponses, flowUsages, assistantResponses, newVariables } = await (async () => {
if (app.version === 'v2') {
@@ -249,7 +257,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
responseChatItemId,
runtimeNodes,
runtimeEdges: initWorkflowEdgeStatus(edges),
variables,
variables: runtimeVariables,
query: removeEmptyUserInput(userQuestion.value),
histories: newHistories,
stream,