fix(web): fix unique key issue

- Add unique key attribute to each field in the AgentStrategy component
- Correct the tool ID generation logic in the AgentNode component (multiToolSelector)
pull/20810/head
zhujiruo 12 months ago
parent 65c7c01d90
commit 919b7a6f1f

@ -120,6 +120,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => {
title={<>
{renderI18nObject(def.label)} {def.required && <span className='text-red-500'>*</span>}
</>}
key={def.variable}
tooltip={def.tooltip && renderI18nObject(def.tooltip)}
inline
>

@ -54,9 +54,9 @@ const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
const field = param.name
const value = inputs.agent_parameters?.[field]?.value
if (value) {
(value as unknown as any[]).forEach((item) => {
(value as unknown as any[]).forEach((item, idx) => {
tools.push({
id: `${param.name}-${i}`,
id: `${param.name}-${idx}`,
providerName: item.provider_name,
})
})

Loading…
Cancel
Save