Repository navigation
Conversation
Local .avif files are now handled consistently with base64 AVIF input.
Previously, Attachment('photo.avif') raised 'Unsupported attachment format'
because .avif was missing from _EXTENSION_MIME_MAP, even though base64 AVIF
was accepted after RailtownAI#1623.
This adds .avif -> image/avif to the extension map, unifying the two input
paths. A URL ending in .avif also works (no-op, already passed through).
Fixes RailtownAI#1730
Co-authored-by: AE <by-ae@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Update modalities.md to include AVIF among supported image formats and add a note about varying provider support for AVIF, since OpenAI, Anthropic, and Gemini do not officially list it while some OpenAI-compatible servers do support it. Co-authored-by: AE <by-ae@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Author
|
Heads up: this overlaps with #1734, which was opened a few minutes earlier for the same issue. Happy to close this one if you prefer that PR. The main difference is that this one also adds AVIF to the supported image formats in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Local .avif files are now handled consistently with base64 AVIF input. Previously,
Attachment("photo.avif")raised "Unsupported attachment format" because.avifwas missing from_EXTENSION_MIME_MAP, even though base64 AVIF was accepted after #1623. This PR adds.avif -> image/avifto the extension map, unifying the two input paths, and updates the docs to match.Fixes #1730
Type of change
Checklist
ruff check . && ruff format .)pytest tests)docs/documentation/agent_design/llms/modalities.md, with a note on varying provider support).avifpaths are now accepted)Notes
What was wrong: The local file path
.avif -> MIMElookup rejected.avifextensions, while the base64 path acceptedimage/avifvia magic-byte detection inattachment_formats.yaml. A URL ending in.avifwas not rejected either, since it fell through to the provider as-is.What changed:
.avif: image/avifto_EXTENSION_MIME_MAPinmessage.py, placed alphabetically first per repository convention.modalities.md.How it was tested:
test_local_avif_consistent_with_base64, which verifies local.aviffiles and base64 AVIF payloads are handled consistentlytest_local_file_formatsparametrized test to include.avifNote on provider support: OpenAI, Anthropic, and Gemini do not officially list AVIF among their accepted image formats, so this swaps today's early, clear error for a possible provider rejection at request time. Some OpenAI-compatible servers (such as PIL-based ones) do support AVIF, and this matches the existing behavior for URLs ending in
.avif, which already pass through without early rejection.