yow1da
March 12, 2025, 9:04am
1
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
jksr
March 12, 2025, 10:02am
2
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
yow1da
March 12, 2025, 12:33pm
3
what model are can I use ?
when I tried to use gemini-2.0-flash I got an error above in the picture
jksr
March 12, 2025, 1:43pm
4
Can you share the workflow again? I tried it with 2.0 flash and it works.
jksr
March 12, 2025, 4:28pm
6
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 ?
yow1da
March 12, 2025, 5:12pm
7
already tried deleting and re-adding, what version of n8n do you use ?