Repository navigation
fix(llm): accept local .avif attachments like base64 AVIF - #1734
Conversation
CoronRing
left a comment
There was a problem hiding this comment.
Thanks, this is good to go once CI is green! It's the one-line fix the issue asked for, the URL test next to test_url is a nice extra, and the PR says clearly which way you went on the provider question, which is exactly what we needed.
One small wording nit, no change needed for this PR: the providers don't list AVIF rather than definitely rejecting it, so I'll soften "do not accept" to "do not list" when I touch that page next.
Heads up on what comes next: #1701 (Attachment v2) replaces _EXTENSION_MIME_MAP with a shared format table. I'll keep your .avif cases when I rebase onto this, so your tests stay in.
Great work; all is clear as day on my side! If you enjoyed the framework, please tell your friends and star the repo so it gets a bit of attention.
Thanks & love from the maintenance team >_<
Summary
Closes #1730. Part of #1347.
Attachment("photo.avif")raisedUnsupported attachment format: .avifbecause.avifwas missing from_EXTENSION_MIME_MAP, while the same image as base64 is detected asimage/avifsince #1623. This adds the.avifentry, so local files and base64 now agree, and a URL ending in.avifgetsmime_type="image/avif"instead of falling through with none.On the provider question from the issue: I went with adding it now rather than waiting for the per-provider allowlists. Base64 AVIF already reaches providers today, so this doesn't open a new path, it just makes the local-file path consistent with it. OpenAI, Anthropic and Gemini will reject it at request time with the generic
LLMError; the modalities page now says so. When the allowlists from #1347 land,.avifcan be restricted there along with the base64 case.Type of change
Checklist
ruff check . && ruff format .)pytest tests)Notes
Added
.avifto the local-file format cases and atest_url_avifnext totest_url; both fail without the change. The unit suite otherwise matches main locally (the Portkey tests and the modules needing extras I don't have installed fail the same way before and after).