fix: toggle vision for remote model
This commit is contained in:
parent
63acb3a275
commit
45ba949d96
@ -107,9 +107,15 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
|
|||||||
if (selectedProvider === 'llamacpp') {
|
if (selectedProvider === 'llamacpp') {
|
||||||
const hasLocalMmproj = await checkMmprojExists(selectedModel.id)
|
const hasLocalMmproj = await checkMmprojExists(selectedModel.id)
|
||||||
setHasMmproj(hasLocalMmproj)
|
setHasMmproj(hasLocalMmproj)
|
||||||
} else {
|
}
|
||||||
// For non-llamacpp providers, only check vision capability
|
// For non-llamacpp providers, only check vision capability
|
||||||
|
else if (
|
||||||
|
selectedProvider !== 'llamacpp' &&
|
||||||
|
selectedModel?.capabilities?.includes('vision')
|
||||||
|
) {
|
||||||
setHasMmproj(true)
|
setHasMmproj(true)
|
||||||
|
} else {
|
||||||
|
setHasMmproj(false)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error checking mmproj:', error)
|
console.error('Error checking mmproj:', error)
|
||||||
@ -119,7 +125,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkMmprojSupport()
|
checkMmprojSupport()
|
||||||
}, [selectedModel?.id, selectedProvider])
|
}, [selectedModel?.capabilities, selectedModel?.id, selectedProvider])
|
||||||
|
|
||||||
// Check if there are active MCP servers
|
// Check if there are active MCP servers
|
||||||
const hasActiveMCPServers = connectedServers.length > 0 || tools.length > 0
|
const hasActiveMCPServers = connectedServers.length > 0 || tools.length > 0
|
||||||
|
|||||||
@ -177,21 +177,13 @@ export const DialogEditModel = ({
|
|||||||
{t('providers:editModel.vision')}
|
{t('providers:editModel.vision')}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Tooltip>
|
<Switch
|
||||||
<TooltipTrigger>
|
id="vision-capability"
|
||||||
<Switch
|
checked={capabilities.vision}
|
||||||
id="vision-capability"
|
onCheckedChange={(checked) =>
|
||||||
checked={capabilities.vision}
|
handleCapabilityChange('vision', checked)
|
||||||
disabled={true}
|
}
|
||||||
onCheckedChange={(checked) =>
|
/>
|
||||||
handleCapabilityChange('vision', checked)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</TooltipTrigger>
|
|
||||||
<TooltipContent>
|
|
||||||
{t('providers:editModel.notAvailable')}
|
|
||||||
</TooltipContent>
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user