Commit 065234e
fix: preserve non-image file MIME type in LiteLlm content conversion
When converting an inlined artifact Part to a LiteLlm/OpenAI file block,
the MIME type of non-image files was dropped and sent as None, so OpenAI
rejected PDFs loaded via load_artifacts (while Gemini and Claude worked).
Propagate the part's mime_type into the file content block.
Close #4174
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 9490615841 parent ecbefd9 commit 065234e
2 files changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
1332 | | - | |
| 1332 | + | |
1333 | 1333 | | |
1334 | 1334 | | |
1335 | 1335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5104 | 5104 | | |
5105 | 5105 | | |
5106 | 5106 | | |
| 5107 | + | |
5107 | 5108 | | |
5108 | 5109 | | |
5109 | 5110 | | |
| |||
5144 | 5145 | | |
5145 | 5146 | | |
5146 | 5147 | | |
| 5148 | + | |
5147 | 5149 | | |
5148 | 5150 | | |
5149 | 5151 | | |
| |||
5189 | 5191 | | |
5190 | 5192 | | |
5191 | 5193 | | |
| 5194 | + | |
5192 | 5195 | | |
5193 | 5196 | | |
5194 | 5197 | | |
| |||
0 commit comments