fix: allow all fileds and not allow model set to auto

This commit is contained in:
Joel
2026-01-16 17:20:11 +08:00
parent f79df6982d
commit 148f92f92d
2 changed files with 18 additions and 25 deletions

View File

@ -64,6 +64,8 @@ const ReasoningConfigForm: React.FC<Props> = ({
}
const handleAutomatic = (key: string, val: any, type: FormTypeEnum) => {
if (type === FormTypeEnum.modelSelector)
return
onChange({
...value,
[key]: {
@ -151,7 +153,8 @@ const ReasoningConfigForm: React.FC<Props> = ({
placeholder,
options,
} = schema
const auto = value[variable]?.auto
const canUseAuto = type !== FormTypeEnum.modelSelector
const auto = canUseAuto ? value[variable]?.auto : 0
const tooltipContent = (tooltip && (
<Tooltip
popupContent={(
@ -241,14 +244,16 @@ const ReasoningConfigForm: React.FC<Props> = ({
)}
</div>
<div className="flex cursor-pointer items-center gap-1 rounded-[6px] border border-divider-subtle bg-background-default-lighter px-2 py-1 hover:bg-state-base-hover" onClick={() => handleAutomatic(variable, !auto, type)}>
<span className="system-xs-medium text-text-secondary">{t('detailPanel.toolSelector.auto', { ns: 'plugin' })}</span>
<Switch
size="xs"
defaultValue={!!auto}
onChange={val => handleAutomatic(variable, val, type)}
/>
</div>
{canUseAuto && (
<div className="flex cursor-pointer items-center gap-1 rounded-[6px] border border-divider-subtle bg-background-default-lighter px-2 py-1 hover:bg-state-base-hover" onClick={() => handleAutomatic(variable, !auto, type)}>
<span className="system-xs-medium text-text-secondary">{t('detailPanel.toolSelector.auto', { ns: 'plugin' })}</span>
<Switch
size="xs"
defaultValue={!!auto}
onChange={val => handleAutomatic(variable, val, type)}
/>
</div>
)}
</div>
{auto === 0 && (
<div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}>