@ai-sdk/google 4.0.0-beta.32 → 4.0.0-beta.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "4.0.0-beta.32",
3
+ "version": "4.0.0-beta.34",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -37,15 +37,15 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@ai-sdk/provider": "4.0.0-beta.10",
40
- "@ai-sdk/provider-utils": "5.0.0-beta.16"
40
+ "@ai-sdk/provider-utils": "5.0.0-beta.17"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
44
44
  "tsup": "^8",
45
45
  "typescript": "5.8.3",
46
46
  "zod": "3.25.76",
47
- "@vercel/ai-tsconfig": "0.0.0",
48
- "@ai-sdk/test-server": "2.0.0-beta.0"
47
+ "@ai-sdk/test-server": "2.0.0-beta.0",
48
+ "@vercel/ai-tsconfig": "0.0.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "zod": "^3.25.76 || ^4.1.8"
@@ -88,22 +88,25 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV4 {
88
88
  return this.config.supportedUrls?.() ?? {};
89
89
  }
90
90
 
91
- private async getArgs({
92
- prompt,
93
- maxOutputTokens,
94
- temperature,
95
- topP,
96
- topK,
97
- frequencyPenalty,
98
- presencePenalty,
99
- stopSequences,
100
- responseFormat,
101
- seed,
102
- tools,
103
- toolChoice,
104
- reasoning,
105
- providerOptions,
106
- }: LanguageModelV4CallOptions) {
91
+ private async getArgs(
92
+ {
93
+ prompt,
94
+ maxOutputTokens,
95
+ temperature,
96
+ topP,
97
+ topK,
98
+ frequencyPenalty,
99
+ presencePenalty,
100
+ stopSequences,
101
+ responseFormat,
102
+ seed,
103
+ tools,
104
+ toolChoice,
105
+ reasoning,
106
+ providerOptions,
107
+ }: LanguageModelV4CallOptions,
108
+ { isStreaming = false }: { isStreaming?: boolean } = {},
109
+ ) {
107
110
  const warnings: SharedV4Warning[] = [];
108
111
 
109
112
  const providerOptionsName = this.config.provider.includes('vertex')
@@ -184,9 +187,10 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV4 {
184
187
  ? { ...resolvedThinking, ...googleOptions?.thinkingConfig }
185
188
  : undefined;
186
189
 
187
- const streamFunctionCallArguments = isVertexProvider
188
- ? (googleOptions?.streamFunctionCallArguments ?? true)
189
- : undefined;
190
+ const streamFunctionCallArguments =
191
+ isStreaming && isVertexProvider
192
+ ? (googleOptions?.streamFunctionCallArguments ?? false)
193
+ : undefined;
190
194
 
191
195
  const toolConfig =
192
196
  googleToolConfig ||
@@ -478,7 +482,10 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV4 {
478
482
  async doStream(
479
483
  options: LanguageModelV4CallOptions,
480
484
  ): Promise<LanguageModelV4StreamResult> {
481
- const { args, warnings, providerOptionsName } = await this.getArgs(options);
485
+ const { args, warnings, providerOptionsName } = await this.getArgs(
486
+ options,
487
+ { isStreaming: true },
488
+ );
482
489
 
483
490
  const headers = combineHeaders(
484
491
  await resolve(this.config.headers),
@@ -192,9 +192,10 @@ export const googleLanguageModelOptions = lazySchema(() =>
192
192
  /**
193
193
  * Optional. When set to true, function call arguments will be streamed
194
194
  * incrementally via partialArgs in streaming responses. Only supported
195
- * on the Vertex AI API (not the Gemini API).
195
+ * on the Vertex AI API (not the Gemini API) and only for Gemini 3+
196
+ * models.
196
197
  *
197
- * @default true
198
+ * @default false
198
199
  *
199
200
  * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
200
201
  */