refactor: use main_model.info["supports_vision"] instead of accepts_images

This commit is contained in:
Paul Gauthier (aider) 2024-10-24 14:02:35 -07:00 committed by Paul Gauthier
parent e0a1eefe0a
commit 9507f3c008
2 changed files with 4 additions and 2 deletions

View file

@ -679,7 +679,7 @@ class Coder:
return chat_files_messages
def get_images_message(self):
if not self.main_model.accepts_images:
if not self.main_model.info.get("supports_vision"):
return None
image_messages = []

View file

@ -748,7 +748,9 @@ class Commands:
f"Cannot add {matched_file} as it's not part of the repository"
)
else:
if is_image_file(matched_file) and not self.coder.main_model.accepts_images:
if is_image_file(matched_file) and not self.coder.main_model.info.get(
"supports_vision"
):
self.io.tool_error(
f"Cannot add image file {matched_file} as the"
f" {self.coder.main_model.name} does not support images."