Issue with AI Agent (Gemini) + Vector Store (Postgres): Bad Request Error

I’m trying to build an AI agent using the Gemini model in n8n, and connect it to a Postgres-based Vector Store (via pgvector). However, when I run the workflow, I keep getting this error:

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[18].parts: contents.parts must not be empty.

It seems related to the contents.parts being empty, but I’m not sure what’s causing this. Has anyone faced something similar? Any advice on how to fix or debug this?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.