feat(frontend): 选择VLLM模型时添加supports_vision判断

由于部分文本对话模型支持视觉/多模态,例如Qwen3.6-27B等。
所以在选择VLLM模型时,额外包含 supports_vision 为 true 的模型
main
wuwc.ew 2026-08-18 15:51:40 +08:00 committed by lyingbug
parent 6ea2485fa1
commit 4e11782438
1 changed files with 10 additions and 2 deletions

View File

@ -84,10 +84,18 @@ const modelDisplayName = (model: ModelConfig) => {
return displayName || model.name
}
const filterModels = (allModels: ModelConfig[]) => {
if (props.modelType === 'VLLM') {
return allModels.filter(m => (m.type === props.modelType || m.parameters.supports_vision === true))
}
return allModels.filter(m => m.type === props.modelType)
}
// 监听 allModels 变化,自动过滤当前类型的模型
watch(() => props.allModels, (newModels) => {
if (newModels && Array.isArray(newModels)) {
models.value = newModels.filter(m => m.type === props.modelType)
models.value = filterModels(newModels)
}
}, { immediate: true })
@ -108,7 +116,7 @@ const loadModels = async () => {
const result = await listModels()
// 前端按类型筛选模型
if (result && Array.isArray(result)) {
models.value = result.filter(m => m.type === props.modelType)
models.value = filterModels(result)
} else {
models.value = []
}