Skip to content

Flatten Mistral image payload to use direct image_url string#73

Closed
Android-PowerUser wants to merge 3 commits intotackle-mistral-ai-rate-limit-issue-wst5gmfrom
find-cause-of-429-error-with-images
Closed

Flatten Mistral image payload to use direct image_url string#73
Android-PowerUser wants to merge 3 commits intotackle-mistral-ai-rate-limit-issue-wst5gmfrom
find-cause-of-429-error-with-images

Conversation

@Android-PowerUser
Copy link
Copy Markdown
Owner

Motivation

  • Simplify the Mistral multimodal request shape by sending the image URL/base64 directly as a string instead of wrapping it in an extra MistralImageUrl object.

Description

  • Replaced MistralImageUrl / ServiceMistralImageUrl wrapper types with a plain String for the image_url field in MistralImageContent and ServiceMistralImageContent.
  • Updated all call sites to pass the data:image/jpeg;base64,... string directly when constructing image content payloads in ScreenCaptureApiClients.kt and PhotoReasoningViewModel.kt.
  • Removed the now-unused MistralImageUrl/ServiceMistralImageUrl data classes and adjusted serializer polymorphic registrations to match the new shape.

Testing

  • Built the app with ./gradlew :app:assemble to ensure serialization and compilation succeed, and the build completed successfully.
  • Ran unit tests with ./gradlew test and all tests passed.

Codex Task

Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

The changes in this PR successfully simplify the Mistral multimodal request structure by removing the unnecessary MistralImageUrl wrapper and using direct string values for image URLs. The refactoring is consistently applied across all three files, maintains proper serialization annotations, and preserves the existing functionality. The flattened structure reduces nesting and improves code clarity without introducing any defects.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@Android-PowerUser Android-PowerUser deleted the find-cause-of-429-error-with-images branch April 9, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant