feat: allow /read command to work with images for vision models

This commit is contained in:
Paul Gauthier (aider) 2024-10-31 14:58:23 -07:00
parent ec40ff5987
commit 704350286c

View file

@ -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