@ai-sdk/google 3.0.97 → 3.0.99

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.
@@ -1072,7 +1072,9 @@ The following Zod features are known to not work with Google Generative AI:
1072
1072
 
1073
1073
  | Model | Image Input | Object Generation | Tool Usage | Tool Streaming | Google Search | URL Context |
1074
1074
  | ------------------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
1075
+ | `gemini-3.6-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1075
1076
  | `gemini-3.5-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1077
+ | `gemini-3.5-flash-lite` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1076
1078
  | `gemini-3.1-pro-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1077
1079
  | `gemini-3.1-flash-image-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1078
1080
  | `gemini-3.1-flash-lite-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.97",
3
+ "version": "3.0.99",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -313,6 +313,8 @@ export function convertToGoogleGenerativeAIMessages(
313
313
  case 'assistant': {
314
314
  systemMessagesAllowed = false;
315
315
 
316
+ let modelResponseHasSignedFunctionCall = false;
317
+
316
318
  contents.push({
317
319
  role: 'model',
318
320
  parts: content
@@ -375,18 +377,27 @@ export function convertToGoogleGenerativeAIMessages(
375
377
  providerOpts?.serverToolType != null
376
378
  ? String(providerOpts.serverToolType)
377
379
  : undefined;
378
-
379
- // For Gemini 3, every replayed functionCall part must carry a
380
- // thoughtSignature or the API returns HTTP 400. If the upstream
381
- // serialization layer dropped the signature, inject the
382
- // documented sentinel so the request still succeeds.
380
+ const isServerToolCall =
381
+ serverToolCallId != null && serverToolType != null;
382
+ const shouldSkipMissingSignatureMitigation =
383
+ // Gemini 3 returns a single signature for a parallel
384
+ // function-call response on the first standard function
385
+ // call. Subsequent standard function calls in the same
386
+ // model response legitimately have no signature.
387
+ !isServerToolCall &&
388
+ thoughtSignature == null &&
389
+ modelResponseHasSignedFunctionCall;
383
390
  const effectiveThoughtSignature =
384
391
  thoughtSignature ??
385
- (isGemini3Model
392
+ (isGemini3Model && !shouldSkipMissingSignatureMitigation
386
393
  ? injectSkipSignature(part.toolName)
387
394
  : undefined);
388
395
 
389
- if (serverToolCallId && serverToolType) {
396
+ if (!isServerToolCall && thoughtSignature != null) {
397
+ modelResponseHasSignedFunctionCall = true;
398
+ }
399
+
400
+ if (isServerToolCall) {
390
401
  return {
391
402
  toolCall: {
392
403
  toolType: serverToolType,
@@ -31,6 +31,8 @@ export type GoogleGenerativeAIModelId =
31
31
  | 'gemini-3.1-flash-lite-preview'
32
32
  | 'gemini-3.1-flash-tts-preview'
33
33
  | 'gemini-3.5-flash'
34
+ | 'gemini-3.5-flash-lite'
35
+ | 'gemini-3.6-flash'
34
36
  // latest version
35
37
  // https://ai.google.dev/gemini-api/docs/models#latest
36
38
  | 'gemini-pro-latest'
@@ -33,6 +33,8 @@ export type GoogleInteractionsModelId =
33
33
  | 'gemini-3.1-flash-lite-preview'
34
34
  | 'gemini-3.1-flash-tts-preview'
35
35
  | 'gemini-3.5-flash'
36
+ | 'gemini-3.5-flash-lite'
37
+ | 'gemini-3.6-flash'
36
38
  | 'lyria-3-clip-preview'
37
39
  | 'lyria-3-pro-preview'
38
40
  | (string & {});