diff --git a/web/app/components/header/account-setting/model-provider-page/model-name/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-name/index.tsx index 3186e28e2e..d88dce5e2d 100644 --- a/web/app/components/header/account-setting/model-provider-page/model-name/index.tsx +++ b/web/app/components/header/account-setting/model-provider-page/model-name/index.tsx @@ -1,6 +1,8 @@ import type { FC, PropsWithChildren } from 'react' import type { ModelItem } from '../declarations' import { cn } from '@/utils/classnames' +import { ModelFeatureEnum } from '../declarations' + import { useLanguage } from '../hooks' import ModelBadge from '../model-badge' import FeatureIcon from '../model-selector/feature-icon' @@ -69,7 +71,12 @@ const ModelName: FC = ({ ) } { - showFeatures && modelItem.features?.map(feature => ( + showFeatures && modelItem.features?.reduce((acc, feature) => { + if (acc.some(f => [ModelFeatureEnum.toolCall, ModelFeatureEnum.multiToolCall, ModelFeatureEnum.streamToolCall].includes(f)) && [ModelFeatureEnum.toolCall, ModelFeatureEnum.multiToolCall, ModelFeatureEnum.streamToolCall].includes(feature)) { + return acc + } + return [...acc, feature] + }, [] as ModelFeatureEnum[]).map(feature => ( = ({ // ) // } - if (feature === ModelFeatureEnum.toolCall) { + if (feature === ModelFeatureEnum.toolCall || feature === ModelFeatureEnum.multiToolCall || feature === ModelFeatureEnum.streamToolCall) { if (showFeaturesLabel) { return ( diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx index 48e1107ba4..98ae192bec 100644 --- a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx +++ b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx @@ -97,7 +97,7 @@ const PopupItem: FC = ({ )} */}
{ - modelItem.features?.includes(ModelFeatureEnum.toolCall) && ( + modelItem.features?.some(feature => [ModelFeatureEnum.toolCall, ModelFeatureEnum.multiToolCall, ModelFeatureEnum.streamToolCall].includes(feature)) && ( = ({
{t('model.capabilities', { ns: 'common' })}
- {modelItem.features?.filter(feature => feature !== ModelFeatureEnum.toolCall).map(feature => ( + {modelItem.features?.filter(feature => ![ModelFeatureEnum.toolCall, ModelFeatureEnum.multiToolCall, ModelFeatureEnum.streamToolCall].includes(feature)).map(feature => ( void className?: string + disabled?: boolean } -const MaxIterations = ({ value = 10, onChange, className }: MaxIterationsProps) => { +const MaxIterations = ({ value = 10, onChange, className, disabled }: MaxIterationsProps) => { return (
@@ -20,11 +21,12 @@ const MaxIterations = ({ value = 10, onChange, className }: MaxIterationsProps) />
{})} min={1} step={1} + disabled={disabled} />
) diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index 7b39dcd055..cb42478481 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -290,7 +290,7 @@ const Panel: FC> = ({ tools={inputs.tools} maxIterations={inputs.max_iterations} hideMaxIterations - disabled={isToolsBlocked} + disabled={isToolsBlocked || !isModelSupportToolCall} disabledTip={toolsDisabledTip} /> )} @@ -335,6 +335,7 @@ const Panel: FC> = ({ className="flex h-10 items-center" value={inputs.max_iterations} onChange={handleMaxIterationsChange} + disabled={!isModelSupportToolCall} />