Update Chat.svelte (#20256)

This commit is contained in:
Classic298 2025-12-30 14:31:13 +01:00 committed by GitHub
parent 214dd50ce9
commit 95ce70c4fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1731,13 +1731,14 @@
if (model) {
// If there are image files, check if model is vision capable
// Skip this check if image generation is enabled, as images may be for editing or are generated outputs in the history
const hasImages = createMessagesList(_history, parentId).some((message) =>
message.files?.some(
(file) => file.type === 'image' || file?.content_type?.startsWith('image/')
)
);
if (hasImages && !(model.info?.meta?.capabilities?.vision ?? true)) {
if (hasImages && !(model.info?.meta?.capabilities?.vision ?? true) && !imageGenerationEnabled) {
toast.error(
$i18n.t('Model {{modelName}} is not vision capable', {
modelName: model.name ?? model.id