refactor: 最大迭代次数从滑块改为固定值下拉选择 (10/20/50/85/128/256/512)

This commit is contained in:
thzxx
2026-06-27 22:10:42 +08:00
parent f2d76f699b
commit c5ae4c9efa
+10 -4
View File
@@ -143,13 +143,19 @@ function AgentSettings() {
const [thinking, setThinking] = useConfig('agent.enableThinking', true); const [thinking, setThinking] = useConfig('agent.enableThinking', true);
const [thinkingEffort, setThinkingEffort] = useConfig('agent.thinkingEffort', 'high'); const [thinkingEffort, setThinkingEffort] = useConfig('agent.thinkingEffort', 'high');
const MAX_ITER_OPTIONS = [10, 20, 50, 85, 128, 256, 512];
return ( return (
<Stack spacing={2}> <Stack spacing={2}>
<Typography variant="subtitle2" sx={{ fontWeight: 600 }}>Agent </Typography> <Typography variant="subtitle2" sx={{ fontWeight: 600 }}>Agent </Typography>
<Box> <FormControl size="small">
<Stack direction="row" justifyContent="space-between"><Typography variant="caption" sx={{ color: 'text.secondary' }}></Typography><Typography variant="caption" sx={{ fontFamily: 'monospace' }}>{maxIter}</Typography></Stack> <InputLabel></InputLabel>
<Slider value={maxIter} onChange={(_, v) => setMaxIter(v as number)} min={1} max={50} size="small" /> <Select value={maxIter} label="最大迭代次数" onChange={(e) => setMaxIter(e.target.value as number)}>
</Box> {MAX_ITER_OPTIONS.map((n) => (
<MenuItem key={n} value={n}>{n}</MenuItem>
))}
</Select>
</FormControl>
<Box> <Box>
<Stack direction="row" justifyContent="space-between"><Typography variant="caption" sx={{ color: 'text.secondary' }}> ()</Typography><Typography variant="caption" sx={{ fontFamily: 'monospace' }}>{timeout / 1000}s</Typography></Stack> <Stack direction="row" justifyContent="space-between"><Typography variant="caption" sx={{ color: 'text.secondary' }}> ()</Typography><Typography variant="caption" sx={{ fontFamily: 'monospace' }}>{timeout / 1000}s</Typography></Stack>
<Slider value={timeout / 1000} onChange={(_, v) => setTimeout_((v as number) * 1000)} min={60} max={1800} step={60} size="small" /> <Slider value={timeout / 1000} onChange={(_, v) => setTimeout_((v as number) * 1000)} min={60} max={1800} step={60} size="small" />