Skip to content

Commit

Permalink
fix: improve PDF support detection and update model suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Nov 27, 2024
1 parent 9c8bde2 commit a649564
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aider/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,12 @@ def get_chat_files_messages(self):

def get_images_message(self, fnames):
supports_images = self.main_model.info.get("supports_vision")
supports_pdfs = self.main_model.info.get("supports_pdf_input")
supports_pdfs = self.main_model.info.get("supports_pdf_input") or self.main_model.info.get(
"max_pdf_size_mb"
)

# https://github.com/BerriAI/litellm/pull/6928
supports_pdfs = "claude-3-5-sonnet-20241022" in self.main_model.name
supports_pdfs = supports_pdfs or "claude-3-5-sonnet-20241022" in self.main_model.name

if not (supports_images or supports_pdfs):
return None
Expand Down Expand Up @@ -1396,9 +1398,7 @@ def show_exhausted_error(self):
res.append("- Ask for smaller changes in each request.")
res.append("- Break your code into smaller source files.")
if "diff" not in self.main_model.edit_format:
res.append(
"- Use a stronger model like gpt-4o, sonnet or opus that can return diffs."
)
res.append("- Use a stronger model that can return diffs.")

if input_tokens >= max_input_tokens or total_tokens >= max_input_tokens:
res.append("")
Expand Down

0 comments on commit a649564

Please sign in to comment.