Extract details from pdf using ai agent

Hey guys. I’m trying to build workflow to extract details from pdf using ai agent.

I’m getting an error below

> Bad request - please check your parameters
> 
> [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse: [400 Bad Request] * GenerateContentRequest.contents[1].parts: contents.parts must not be empty.

N8N version: 1.73.0
Chat model: gemini-2.0-flash
Sefl hosted
DB: postgres

Hey @yow1da ! You have to convert the PDF to an image first if you want to use the agent node. Here’s how you could do it:

Here are the details if you need to change the params for the Stirling API https://app.swaggerhub.com/apis-docs/Frooodle/Stirling-PDF/0.44.0#/Convert/convertToImage


what model are can I use ?
when I tried to use gemini-2.0-flash I got an error above in the picture

Can you share the workflow again? I tried it with 2.0 flash and it works.

@jksr thanks very much

Hmm, it works fine for me - can you confirm the same setup in the Gemini Chat Model?

Maybe just try to delete it and re-add ?

already tried deleting and re-adding, what version of n8n do you use ?

I am still on 1.79.3