fix: plugin run & setting quote variables (#2150)
* fix * fix * change variables & variablelabels show condition * fix type * fix
This commit is contained in:
@@ -14,7 +14,10 @@ import { RuntimeNodeItemType } from '@fastgpt/global/core/workflow/runtime/type'
|
||||
import { removeEmptyUserInput } from '@fastgpt/global/core/chat/utils';
|
||||
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 { NextAPI } from '@/service/middleware/entry';
|
||||
import { GPTMessages2Chats } from '@fastgpt/global/core/chat/adapt';
|
||||
import { ChatCompletionMessageParam } from '@fastgpt/global/core/ai/type';
|
||||
@@ -63,6 +66,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
// Plugin need to replace inputs
|
||||
if (isPlugin) {
|
||||
nodes = updatePluginInputByVariables(nodes, variables);
|
||||
variables = filterPluginInputVariables(variables, nodes);
|
||||
} else {
|
||||
if (!userInput) {
|
||||
throw new Error('Params Error');
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user