Commit c6f389d
fix: Refine Ollama content flattening and provider checks
- Stripping whitespace from custom LLM provider and model names when checking for "ollama_chat".
- Enhancing `_flatten_ollama_content` to correctly handle content that is None, a string, a dictionary, or an iterable (like a tuple) of content blocks, not just lists. This aligns with LiteLLM's `OpenAIMessageContent` type being an `Iterable`.
Close #3928
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 8458480171 parent 1add41e commit c6f389d
File tree
2 files changed
+33
-6
lines changed- src/google/adk/models
- tests/unittests/models
2 files changed
+33
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
632 | 635 | | |
633 | | - | |
| 636 | + | |
634 | 637 | | |
635 | 638 | | |
636 | 639 | | |
| |||
644 | 647 | | |
645 | 648 | | |
646 | 649 | | |
647 | | - | |
| 650 | + | |
648 | 651 | | |
649 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
650 | 666 | | |
651 | | - | |
| 667 | + | |
652 | 668 | | |
653 | 669 | | |
654 | 670 | | |
| |||
658 | 674 | | |
659 | 675 | | |
660 | 676 | | |
661 | | - | |
| 677 | + | |
662 | 678 | | |
663 | | - | |
| 679 | + | |
664 | 680 | | |
665 | 681 | | |
666 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
1552 | 1563 | | |
1553 | 1564 | | |
1554 | 1565 | | |
| |||
0 commit comments