From 704350286cc84a72edab00e78e4046c572eeb818 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 31 Oct 2024 14:58:23 -0700 Subject: [PATCH] feat: allow /read command to work with images for vision models --- aider/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index 32c066471..9a8e899b8 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1199,9 +1199,10 @@ class Commands: self.io.tool_error(f"Not a file or directory: {abs_path}") def _add_read_only_file(self, abs_path, original_name): - if is_image_file(original_name): + if is_image_file(original_name) and not self.coder.main_model.info.get("supports_vision"): self.io.tool_error( - f"Cannot add image file {original_name} as read-only. Use /add for images instead." + f"Cannot add image file {original_name} as the" + f" {self.coder.main_model.name} does not support images." ) return