From f79a90fb21bea59d4b5d1899809628321e23b446 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Thu, 17 Jul 2025 16:07:06 +0800 Subject: [PATCH] fix agent default --- web/app/components/workflow/blocks.tsx | 5 ----- web/app/components/workflow/nodes/agent/default.ts | 11 ----------- web/app/components/workflow/types.ts | 2 -- 3 files changed, 18 deletions(-) delete mode 100644 web/app/components/workflow/blocks.tsx diff --git a/web/app/components/workflow/blocks.tsx b/web/app/components/workflow/blocks.tsx deleted file mode 100644 index 334ddbf087..0000000000 --- a/web/app/components/workflow/blocks.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { BlockEnum } from './types' - -export const ALL_AVAILABLE_BLOCKS = Object.values(BlockEnum) -export const ALL_CHAT_AVAILABLE_BLOCKS = ALL_AVAILABLE_BLOCKS.filter(key => key !== BlockEnum.End && key !== BlockEnum.Start) as BlockEnum[] -export const ALL_COMPLETION_AVAILABLE_BLOCKS = ALL_AVAILABLE_BLOCKS.filter(key => key !== BlockEnum.Answer && key !== BlockEnum.Start) as BlockEnum[] diff --git a/web/app/components/workflow/nodes/agent/default.ts b/web/app/components/workflow/nodes/agent/default.ts index ec0df2a2ff..c2d6adecc1 100644 --- a/web/app/components/workflow/nodes/agent/default.ts +++ b/web/app/components/workflow/nodes/agent/default.ts @@ -1,5 +1,4 @@ import type { StrategyDetail, StrategyPluginDetail } from '@/app/components/plugins/types' -import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/blocks' import { BlockEnum, type NodeDefault } from '../../types' import type { AgentNodeType } from './types' import { FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' @@ -16,16 +15,6 @@ const nodeDefault: NodeDefault = { defaultValue: { version: '2', }, - getAvailablePrevNodes(isChatMode) { - return isChatMode - ? ALL_CHAT_AVAILABLE_BLOCKS - : ALL_COMPLETION_AVAILABLE_BLOCKS - }, - getAvailableNextNodes(isChatMode) { - return isChatMode - ? ALL_CHAT_AVAILABLE_BLOCKS - : ALL_COMPLETION_AVAILABLE_BLOCKS - }, checkValid(payload, t, moreDataForCheckValid: { strategyProvider?: StrategyPluginDetail, strategy?: StrategyDetail diff --git a/web/app/components/workflow/types.ts b/web/app/components/workflow/types.ts index fd80e74c24..5a471d9920 100644 --- a/web/app/components/workflow/types.ts +++ b/web/app/components/workflow/types.ts @@ -322,8 +322,6 @@ export type NodeDefault = { } defaultValue: Partial defaultRunInputData?: Record - getAvailablePrevNodes: (isChatMode: boolean) => BlockEnum[] - getAvailableNextNodes: (isChatMode: boolean) => BlockEnum[] checkValid: (payload: T, t: any, moreDataForCheckValid?: any) => { isValid: boolean; errorMessage?: string } getOutputVars?: (payload: T, ragVariables?: Var[]) => Var[] }