Skip to content

Commit

Permalink
perf: rename fun
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Aug 29, 2024
1 parent 934c1fe commit 1931161
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/global/core/workflow/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ export const removePluginInputVariables = (
);
};

export function replaceVariableLabel({
// replace {{$xx.xx$}} variables for text
export function replaceEditorVariable({
text,
nodes,
variables,
Expand Down
4 changes: 2 additions & 2 deletions packages/service/core/workflow/dispatch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '@fastgpt/global/core/workflow/node/constant';
import { replaceVariable } from '@fastgpt/global/common/string/tools';
import { getSystemTime } from '@fastgpt/global/common/time/timezone';
import { replaceVariableLabel } from '@fastgpt/global/core/workflow/utils';
import { replaceEditorVariable } from '@fastgpt/global/core/workflow/utils';

import { dispatchWorkflowStart } from './init/workflowStart';
import { dispatchChatCompletion } from './chat/oneapi';
Expand Down Expand Up @@ -368,7 +368,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
let value = replaceVariable(input.value, variables);

// replace {{$xx.xx$}} variables
value = replaceVariableLabel({
value = replaceEditorVariable({
text: value,
nodes: runtimeNodes,
variables,
Expand Down
4 changes: 2 additions & 2 deletions packages/service/core/workflow/dispatch/tools/runUpdateVar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getReferenceVariableValue } from '@fastgpt/global/core/workflow/runtime
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 { replaceVariableLabel } from '@fastgpt/global/core/workflow/utils';
import { replaceEditorVariable } from '@fastgpt/global/core/workflow/utils';

type Props = ModuleDispatchProps<{
[NodeInputKeyEnum.updateList]: TUpdateListItem[];
Expand All @@ -32,7 +32,7 @@ export const dispatchUpdateVariable = async (props: Props): Promise<Response> =>
const formatValue = valueTypeFormat(item.value?.[1], item.valueType);

return typeof formatValue === 'string'
? replaceVariableLabel({
? replaceEditorVariable({
text: formatValue,
nodes: runtimeNodes,
variables,
Expand Down

0 comments on commit 1931161

Please sign in to comment.