Skip to content

Commit 755f0a7

Browse files
committed
Feat: max_rounds is only displayed if the agent has subagents or tools
1 parent 63c1502 commit 755f0a7

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

web/src/pages/agent/form/agent-form/index.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
} from '../../constant';
3232
import { INextOperatorForm } from '../../interface';
3333
import useGraphStore from '../../store';
34-
import { isBottomSubAgent } from '../../utils';
34+
import { hasSubAgentOrTool, isBottomSubAgent } from '../../utils';
3535
import { buildOutputList } from '../../utils/build-output-list';
3636
import { DescriptionField } from '../components/description-field';
3737
import { FormWrapper } from '../components/form-wrapper';
@@ -231,18 +231,20 @@ function AgentForm({ node }: INextOperatorForm) {
231231
</FormItem>
232232
)}
233233
/>
234-
<FormField
235-
control={form.control}
236-
name={`max_rounds`}
237-
render={({ field }) => (
238-
<FormItem className="flex-1">
239-
<FormLabel>{t('flow.maxRounds')}</FormLabel>
240-
<FormControl>
241-
<NumberInput {...field}></NumberInput>
242-
</FormControl>
243-
</FormItem>
244-
)}
245-
/>
234+
{hasSubAgentOrTool(edges, node?.id) && (
235+
<FormField
236+
control={form.control}
237+
name={`max_rounds`}
238+
render={({ field }) => (
239+
<FormItem className="flex-1">
240+
<FormLabel>{t('flow.maxRounds')}</FormLabel>
241+
<FormControl>
242+
<NumberInput {...field}></NumberInput>
243+
</FormControl>
244+
</FormItem>
245+
)}
246+
/>
247+
)}
246248
<FormField
247249
control={form.control}
248250
name={`exception_method`}

0 commit comments

Comments
 (0)