Description
All @ai-sdk/google-vertex generateText / generateObject calls (Vertex unary endpoint generateContent) return 400 after upgrading to 4.0.106:
Unable to submit request because streaming function call is not supported in unary API.
Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini
Even without any tools, all Vertex models (gemini-2.5-flash-lite, gemini-3-flash-preview, etc.) fail 100%. The streaming endpoint (streamGenerateContent) is not affected.
Root Cause
4.0.106 (released 2026-04-09, likely from #11126) unconditionally adds to the request body:
{
"toolConfig": {
"functionCallingConfig": {
"streamFunctionCallArguments": true
}
}
}
Two issues:
- This parameter must not be sent to the unary endpoint (
generateContent) — Vertex API rejects it
- This parameter should not be sent when no tools/functionDeclarations are present
Bisection
| Version |
toolConfig in body |
Result |
| 4.0.105 |
none |
✅ works |
| 4.0.106 |
{streamFunctionCallArguments: true} |
❌ 400 |
Code example
import { createVertex } from "@ai-sdk/google-vertex";
import { generateText } from "ai";
const vertex = createVertex({ apiKey: process.env.GOOGLE_VERTEX_API_KEY });
// Works in 4.0.105, fails in 4.0.106
const { text } = await generateText({
model: vertex("gemini-2.5-flash-lite"),
prompt: "Say hello",
});
Fetch intercept confirms the difference:
- 4.0.105:
{"generationConfig":{}, "contents":[...]} — clean
- 4.0.106:
{"generationConfig":{}, "contents":[...], "toolConfig":{"functionCallingConfig":{"streamFunctionCallArguments":true}}} — breaks
AI SDK Version
6.0.156
AI SDK Provider + Version
@ai-sdk/google-vertex 4.0.106
Other information
- Runtime: Bun 1.3.10 (also reproducible with Node.js)
- Vertex API mode: Express Mode (API Key auth)
- Models affected: all tested models (gemini-2.5-flash-lite, gemini-3-flash-preview, etc.)
- Workaround: pin to 4.0.105
Suggested fix
streamFunctionCallArguments should:
- Only be set for the streaming endpoint (
streamGenerateContent), not unary (generateContent)
- Only be set when tools/functionDeclarations are present
- Or be opt-in rather than default-on
Description
All
@ai-sdk/google-vertexgenerateText/generateObjectcalls (Vertex unary endpointgenerateContent) return 400 after upgrading to 4.0.106:Even without any tools, all Vertex models (gemini-2.5-flash-lite, gemini-3-flash-preview, etc.) fail 100%. The streaming endpoint (
streamGenerateContent) is not affected.Root Cause
4.0.106 (released 2026-04-09, likely from #11126) unconditionally adds to the request body:
{ "toolConfig": { "functionCallingConfig": { "streamFunctionCallArguments": true } } }Two issues:
generateContent) — Vertex API rejects itBisection
{streamFunctionCallArguments: true}Code example
Fetch intercept confirms the difference:
{"generationConfig":{}, "contents":[...]}— clean{"generationConfig":{}, "contents":[...], "toolConfig":{"functionCallingConfig":{"streamFunctionCallArguments":true}}}— breaksAI SDK Version
6.0.156
AI SDK Provider + Version
@ai-sdk/google-vertex 4.0.106
Other information
Suggested fix
streamFunctionCallArgumentsshould:streamGenerateContent), not unary (generateContent)