George | Novosapien
02/27/2025, 4:40 PMKyle
03/01/2025, 4:20 PMGeorge | Novosapien
03/04/2025, 9:46 AMKyle
03/07/2025, 1:00 AMKyle
03/07/2025, 1:00 AMKyle
03/11/2025, 11:45 AMGeorge | Novosapien
03/19/2025, 10:19 AMKyle
03/20/2025, 2:30 AMKyle
03/24/2025, 11:34 AMGeorge | Novosapien
03/27/2025, 7:23 PMKyle
03/29/2025, 1:49 PMGeorge | Novosapien
04/02/2025, 5:05 PMModel request failed (attempt #2, reason: ([VertexAI.ClientError]: got status: 400 Bad Request. {"error":{"code":400,"message":"Invalid JSON payload received. Unknown name \"text\" at 'contents[7].parts[0]': Proto field is not repeating, cannot start list.","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis....))
Kyle
04/06/2025, 12:38 PMGeorge | Novosapien
04/09/2025, 6:09 PMKyle
04/11/2025, 1:21 AMGeorge | Novosapien
04/12/2025, 10:59 AMKyle
04/14/2025, 2:07 AM400 INVALID_ARGUMENT
error. Here’s what we’ve found:
1. Why the Error Occurs
- The logs show your system is sending requests to Gemini/Vertex in a format that includes multiple "parts"
arrays with "text"
fields.
- Google’s LLM endpoint expects one continuous string of "content"
per message; it does not support "parts"
or nested "text"
arrays.
- This discrepancy causes the INVALID_ARGUMENT
error.
2. Why We’re Not Considering It a Platform Issue
- The request payload includes large blocks of internal prompt tags (e.g., <who_you_are>
, <skill_graph>
, etc.) and an array of “text” fields, which appear to come from an internal AI testing setup.
- In normal production usage, these tags or arrays wouldn’t be passed to Vertex.
- Essentially, the platform works for standard calls that flatten messages into `"content"`; the unusual “parts” format is unique to your test scenario.
3. Recommended Next Steps for You
- Flatten your messages so each message has a top-level "content"
string rather than an array of "parts"
.
- Remove any raw <xml>
or <skill_graph>
tags from the final payload before sending to Google.
- If your conversation includes a list of times or other data, convert it to a single string or break it into multiple simple messages (again, each with "content"
).
4. Bottom Line
- The error arises from JSON formatting that Vertex/Gemini doesn’t allow.
- This is not a bug in Gemini or the API; it’s a matter of conforming to Google’s message schema.
- Once you adjust the message format and remove the extra "parts"
arrays, your requests should process correctly.
I hope that clarifies what happened and how you can address it on your side. If you have any more questions, feel free to let me know!George | Novosapien
04/18/2025, 10:08 AMKyle
04/18/2025, 4:15 PM