diff --git a/web/app/components/plugins/constants.ts b/web/app/components/plugins/constants.ts index 40a3f0da83..02439be510 100644 --- a/web/app/components/plugins/constants.ts +++ b/web/app/components/plugins/constants.ts @@ -21,7 +21,7 @@ export const tagKeys = [ export const categoryKeys = [ 'model', 'tool', - 'agent', + 'agent-strategy', 'extension', 'bundle', ] diff --git a/web/app/components/plugins/hooks.ts b/web/app/components/plugins/hooks.ts index 371b769019..f4b81d98c1 100644 --- a/web/app/components/plugins/hooks.ts +++ b/web/app/components/plugins/hooks.ts @@ -42,10 +42,10 @@ export const useCategories = (translateFromOut?: TFunction) => { const t = translateFromOut || translation const categories = categoryKeys.map((category) => { - if (category === 'agent') { + if (category === 'agent-strategy') { return { - name: 'agent_strategy', - label: t(`plugin.category.${category}s`), + name: 'agent-strategy', + label: t('plugin.category.agents'), } } return { @@ -70,10 +70,10 @@ export const useSingleCategories = (translateFromOut?: TFunction) => { const t = translateFromOut || translation const categories = categoryKeys.map((category) => { - if (category === 'agent') { + if (category === 'agent-strategy') { return { - name: 'agent_strategy', - label: t(`plugin.categorySingle.${category}`), + name: 'agent-strategy', + label: t('plugin.categorySingle.agent'), } } return { diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index b58c25f9e3..15da9991a6 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -6,7 +6,7 @@ export enum PluginType { tool = 'tool', model = 'model', extension = 'extension', - agent = 'agent_strategy', + agent = 'agent-strategy', } export enum PluginSource { diff --git a/web/app/components/tools/utils/to-form-schema.ts b/web/app/components/tools/utils/to-form-schema.ts index 4e83248c9b..7086c903d1 100644 --- a/web/app/components/tools/utils/to-form-schema.ts +++ b/web/app/components/tools/utils/to-form-schema.ts @@ -1,5 +1,5 @@ import type { ToolCredential, ToolParameter } from '../types' -const toType = (type: string) => { +export const toType = (type: string) => { switch (type) { case 'string': return 'text-input' diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx index 4ec46a6d61..7efd77b4c5 100644 --- a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx +++ b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx @@ -19,6 +19,7 @@ import { useWorkflowStore } from '../../../store' import { useRenderI18nObject } from '@/hooks/use-i18n' import type { NodeOutPutVar } from '../../../types' import type { Node } from 'reactflow' +import { toType } from '@/app/components/tools/utils/to-form-schema' export type Strategy = { agent_strategy_provider_name: string @@ -150,7 +151,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => { onGenerated={handleGenerated} title={renderI18nObject(schema.label)} headerClassName='bg-transparent px-0 text-text-secondary system-sm-semibold-uppercase' - containerClassName='bg-transparent' + containerBackgroundClassName='bg-transparent' gradientBorder={false} isSupportPromptGenerator={!!schema.auto_generate?.type} titleTooltip={schema.tooltip && renderI18nObject(schema.tooltip)} @@ -181,7 +182,18 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => { strategy ?