Closed zzkzzk1984 closed 1 month ago
To add more iterations in the Dify platform, you can adjust the max_iteration
property in the tempPayload
object. This can be done using a slider or an input field within the AgentSetting
component. Here is the relevant code snippet:
const maxIterationsMin = 1
const maxIterationsMax = 5
...
<ItemPanel
className='mb-4'
icon={
<Unblur className='w-4 h-4 text-[#FB6514]' />
}
name={t('appDebug.agent.setting.maximumIterations.name')}
description={t('appDebug.agent.setting.maximumIterations.description')}
>
<div className='flex items-center'>
<Slider
className='mr-3 w-[156px]'
min={maxIterationsMin}
max={maxIterationsMax}
value={tempPayload.max_iteration}
onChange={(value) => {
setTempPayload({
...tempPayload,
max_iteration: value,
})
}}
/>
<input
type="number"
min={maxIterationsMin}
max={maxIterationsMax} step={1}
className="block w-11 h-7 leading-7 rounded-lg border-0 pl-1 px-1.5 bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:ring-1 focus:ring-inset focus:ring-primary-600"
value={tempPayload.max_iteration}
onChange={(e) => {
let value = parseInt(e.target.value, 10)
if (value < maxIterationsMin)
value = maxIterationsMin
if (value > maxIterationsMax)
value = maxIterationsMax
setTempPayload({
...tempPayload,
max_iteration: value,
})
}} />
</div>
</ItemPanel>
This code allows you to set the number of iterations within the range defined by maxIterationsMin
and maxIterationsMax
[1].
To continue talking to Dosu, mention @dosu.
This template is for bug reports
Self Checks
Dify version
0.8.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
How to add more iterations in iteration
✔️ Expected Behavior
Iterations can be added within iterations
❌ Actual Behavior
No response