Hello,
I encountered this issue about 10 days ago, using an Angular app with Vertex AI to call gemini-2.5-flash:
const vertexAI = getAI(this.firebaseApp);
this.model = getGenerativeModel(vertexAI, {
model: “gemini-2.5-flash”,
systemInstruction: systemInstruction,
tools: [productsToolSet],
});
I’m wondering if anyone else is experiencing it, and if Google is aware of it and working on a fix. Thanks in advance.
Expected Behavior:
The model should successfully process all tool calls on a cold start, regardless of the function’s parameters or return type, and return a 200 OK status.
-Scenario A (Fails): Tool returns a complex object
- Configure a chat session using the gemini-2.5-flash model.
- Define a tool with no parameters that returns a complex object, such as getUsers, which returns User array object.
- On a cold start, send a prompt to trigger this tool (e.g., “list users”).
- Result: The API call fails with a 500 Internal Server Error.
-Scenario B (Succeeds): Tool returns a primitive type
- Configure a chat session using the gemini-2.5-flash model.
- Define a tool with no parameters that returns a primitive type, such as displayCart, which returns a string.
- On a cold start, send a simple text prompt (e.g., “Hello”) to warm up the model.
- Send a second prompt to trigger the “displayCart” tool (e.g., “list cart”).
- Result: The API call succeeds with a 200 OK status.
Additional Information:
This bug is specific to the gemini-2.5-flash model. The issue is not reproducible with the gemini-2.0-flash-001 model.
Attached screenshot shows the 500 error from the console.