fix: fix cannot select stream-tool-call in agent modal (#17015)

This commit is contained in:
Good Wood
2025-03-29 14:47:28 +08:00
committed by GitHub
parent 87034e26ae
commit 42968cb945
5 changed files with 14 additions and 12 deletions

View File

@@ -55,6 +55,7 @@ export enum ModelFeatureEnum {
toolCall = 'tool-call',
multiToolCall = 'multi-tool-call',
agentThought = 'agent-thought',
streamToolCall = 'stream-tool-call',
vision = 'vision',
video = 'video',
document = 'document',

View File

@@ -15,6 +15,7 @@ import { useLanguage } from '../hooks'
import PopupItem from './popup-item'
import { XCircle } from '@/app/components/base/icons/src/vender/solid/general'
import { useModalContext } from '@/context/modal-context'
import { supportFunctionCall } from '@/utils/tool-call'
type PopupProps = {
defaultModel?: DefaultModel
@@ -50,7 +51,7 @@ const Popup: FC<PopupProps> = ({
return true
return scopeFeatures.every((feature) => {
if (feature === ModelFeatureEnum.toolCall)
return modelItem.features?.some(featureItem => featureItem === ModelFeatureEnum.toolCall || featureItem === ModelFeatureEnum.multiToolCall)
return supportFunctionCall(modelItem.features)
return modelItem.features?.some(featureItem => featureItem === feature)
})
})