Code execution and PDF document understanding are mutually exclusive in Gemini API, and this has been reported to the Gemini team over a year ago, see Code execution switched off if a PDF is attached
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Gemini generateContent API: DOCX generated by Code Execution cannot be used as input (Unsupported MIME type) | 1 | 159 | July 2, 2026 | |
| How come gemini studio can use unsupported mimetype? | 5 | 422 | June 24, 2024 | |
| Upload PDF to Gemini File API | 11 | 2123 | February 6, 2025 | |
| Code execution switched off if a PDF is attached | 5 | 285 | August 31, 2026 | |
| Error 400 (INVALID_ARGUMENT) when using `gemini-2.5-flash` with `generate_content_stream` | 6 | 6472 | December 18, 2025 |