From b7e8517b31e6747576cd3e2227318934f60dbe85 Mon Sep 17 00:00:00 2001 From: "Junjie.M" <118170653@qq.com> Date: Wed, 16 Apr 2025 17:24:09 +0800 Subject: [PATCH] feat: agent strategy parameter add help information (#18192) --- api/core/agent/plugin_entities.py | 1 + web/app/components/plugins/types.ts | 3 +-- web/app/components/workflow/nodes/agent/panel.tsx | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/core/agent/plugin_entities.py b/api/core/agent/plugin_entities.py index 6cf3975333..9c722baa23 100644 --- a/api/core/agent/plugin_entities.py +++ b/api/core/agent/plugin_entities.py @@ -52,6 +52,7 @@ class AgentStrategyParameter(PluginParameter): return cast_parameter_value(self, value) type: AgentStrategyParameterType = Field(..., description="The type of the parameter") + help: Optional[I18nObject] = None def init_frontend_parameter(self, value: Any): return init_frontend_parameter(self, self.type, value) diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index 6c42e50123..5ed05d4523 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -406,8 +406,7 @@ export type VersionProps = { export type StrategyParamItem = { name: string label: Record - human_description: Record - llm_description: string + help: Record placeholder: Record type: string scope: string diff --git a/web/app/components/workflow/nodes/agent/panel.tsx b/web/app/components/workflow/nodes/agent/panel.tsx index da87312a90..6a80728d91 100644 --- a/web/app/components/workflow/nodes/agent/panel.tsx +++ b/web/app/components/workflow/nodes/agent/panel.tsx @@ -27,6 +27,7 @@ export function strategyParamToCredientialForm(param: StrategyParamItem): Creden variable: param.name, show_on: [], type: toType(param.type), + tooltip: param.help, } } @@ -53,6 +54,7 @@ const AgentPanel: FC> = (props) => { outputSchema, handleMemoryChange, } = useConfig(props.id, props.data) + console.log('currentStrategy', currentStrategy) const { t } = useTranslation() const nodeInfo = useMemo(() => { if (!runResult)