feat(gemini): Phase 4 -- vision / multimodal (inlineData)#1655
Merged
Conversation
Wire up MessagePart::Image conversion to Gemini inlineData parts format. - Add GeminiInlineData struct with camelCase serde serialization - Add inline_data field to GeminiPart - Handle MessagePart::Image in convert_message_parts (base64-encode raw bytes) - Set supports_vision() to true - Add unit tests: single image, multiple images, mixed text+image, serialization Closes #1596. Part of epic #1592.
b9c72f2 to
282d445
Compare
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
MessagePart::Imageto GeminiinlineDataparts ({ "inlineData": { "mimeType": "...", "data": "<base64>" } })supports_vision()now returnstrueCloses #1596. Part of epic #1592.
Test plan
cargo nextest run -p zeph-llm— all 5231 tests passcargo clippy --workspace --features full -- -D warnings— cleancargo +nightly fmt --check— cleantest_image_part_converted_to_inline_dataverifies base64 encoding + mimeType round-triptest_multiple_images_in_single_messageverifies 2 images produce 2 inlineData partstest_mixed_text_and_image_partsverifies text and image parts coexist in correct ordertest_inline_data_serializes_to_camel_caseverifiesinlineData/mimeTypeJSON field names