Commit 6469a74
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.
Co-authored-by: Malte Heuser <[email protected]>
Co-authored-by: Konstantin Pavlov <[email protected]>
1 parent 639fe72 commit 6469a74
File tree
2 files changed
+83
-1
lines changed- prompt/prompt-executor/prompt-executor-clients/prompt-executor-google-client/src
- commonMain/kotlin/ai/koog/prompt/executor/clients/google
- jvmTest/kotlin/ai/koog/prompt/executor/clients/google
2 files changed
+83
-1
lines changedLines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
649 | 672 | | |
650 | 673 | | |
651 | 674 | | |
| |||
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
| 11 | + | |
8 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
| |||
325 | 334 | | |
326 | 335 | | |
327 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
328 | 387 | | |
0 commit comments