Commit cde852a
Fix AttributeError when image_url is string shorthand with base64 data
Handle both string shorthand and dict formats for image_url in
_is_image_type_with_blob_content and redact_blob_message_parts functions.
The OpenAI API supports both formats:
- {"type": "image_url", "image_url": "data:..."}
- {"type": "image_url", "image_url": {"url": "data:..."}}
Previously, calling .get("url", "") on a string raised AttributeError.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 51ff087 commit cde852a
2 files changed
+45
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
601 | 608 | | |
602 | 609 | | |
603 | 610 | | |
| |||
682 | 689 | | |
683 | 690 | | |
684 | 691 | | |
685 | | - | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
686 | 697 | | |
687 | 698 | | |
688 | 699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
848 | 880 | | |
849 | 881 | | |
850 | 882 | | |
| |||
0 commit comments