Skip to content

Conversation

@mltheuser
Copy link
Contributor

@mltheuser mltheuser commented Nov 10, 2025

YouTrack link: https://youtrack.jetbrains.com/issue/KG-487/GoogleLLMClient-does-not-support-InlineData-part-type
#954

Motivation and Context

Currently, GoogleLLMClient throws an IllegalStateException: Not supported part type: InlineData when processing responses from Gemini models that return binary content, such as images (e.g., from gemini-2.5-flash-image). This crash occurs because the processGoogleCandidate function lacks a handler for the GooglePart.InlineData type.

This PR adds the necessary logic to correctly parse InlineData parts into Message.Assistant messages containing either ContentPart.Image or ContentPart.File, allowing the client to support multimodal responses from Google's API.

>> Important Note <<

gemini-2.5-flash-image is not in GoogleModels.kt and therefor nor officially supported yet. For that reason there are only unit tests for the InlineData handler in this PR. I would be open to add this Model but best to open a separate Issue for it and discuss.

Breaking Changes

None. This change is a non-breaking bug fix that adds support for a previously unhandled response type. Existing functionality is unaffected.


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

Copy link
Collaborator

@EugeneTheDev EugeneTheDev left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you

@mltheuser
Copy link
Contributor Author

Sorry forgot about the linter. Should pass now.

@mltheuser
Copy link
Contributor Author

You might want to remove this from the CONTRIBUTING.md or clarify it further:

* Use imports with '*'.

It is why I made them * imports in the first place causing the linter error.

Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Good in general, but I suggest avoiding mimeType conversions and keep it straightforward

@EugeneTheDev EugeneTheDev merged commit 6469a74 into JetBrains:develop Nov 14, 2025
10 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.

GoogleLLMClient does not support InlineData part type

3 participants