Skip to content

Make mime type stuff work#207

Merged
Alex Z (CLowbrow) merged 3 commits intomainfrom
alex/fix-mime-stuff
Apr 29, 2026
Merged

Make mime type stuff work#207
Alex Z (CLowbrow) merged 3 commits intomainfrom
alex/fix-mime-stuff

Conversation

@CLowbrow
Copy link
Copy Markdown
Contributor

@CLowbrow Alex Z (CLowbrow) commented Apr 29, 2026

Vetex was having issues without mime types

shamelessly copying #206

}
}

fn mime_type_from_url(url: &str) -> String {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this worth generalizing as a public helper in case it is needed outside of Google?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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('.') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch i'll use the actual vertex list.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@CLowbrow Alex Z (CLowbrow) merged commit d17a951 into main Apr 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants