Make mime type stuff work#207
Conversation
| } | ||
| } | ||
|
|
||
| fn mime_type_from_url(url: &str) -> String { |
There was a problem hiding this comment.
Is this worth generalizing as a public helper in case it is needed outside of Google?
There was a problem hiding this comment.
Ehhh im not sure vertex has weird requirements around what mime types it accepts I'd like to keep it separate.
| return content_type; | ||
| } | ||
|
|
||
| if let Some((_, extension)) = metadata.filename.rsplit_once('.') { |
There was a problem hiding this comment.
May be worth covering audio (mp3/wav/m4a) and video (mp4/mov/webm) for Gemini?
| } else if extension.eq_ignore_ascii_case("bmp") { | ||
| Some("image/bmp") | ||
| } else if extension.eq_ignore_ascii_case("svg") { | ||
| Some("image/svg+xml") |
There was a problem hiding this comment.
Not sure how meaningful, but Vertex Gemini models do not support svg/xml or bmp: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-flash
There was a problem hiding this comment.
good catch i'll use the actual vertex list.
Jessica Alder (jessicaalder-lgtm)
left a comment
There was a problem hiding this comment.
Looks good to me, nice adding the cross-provider expected-differences and snapshots too. I added some comments, but nothing blocking if you think they're fine. LGTM
Vetex was having issues without mime types
shamelessly copying #206