GenkitG
Genkit5w ago
17 replies
spotty-amber

Hi team, it seems that Genkit's OpenAI

Hi team, it seems that Genkit's OpenAI adapter does not support sending base64 PDFS for multi-modality: https://platform.openai.com/docs/guides/pdf-files#base64-encoded-files

I'm getting this error: BadRequestError: 400 Invalid MIME type. Only image types are supported.

Any help would be highly apprecated!

Just for clarity, I'm doing this with Genkit: { media: { url: dataUrl, contentType: "application/pdf" } } which works great for Gemini models, but Genkit's media format maps to OpenAI's image_url type, but PDFs require OpenAI's newer type: "file" format. The Genkit OpenAI plugin likely doesn't support this yet.
Was this page helpful?