@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.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +2 -2
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal/index.js +14 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -2
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +2 -0
- package/package.json +1 -1
- package/src/convert-to-google-generative-ai-messages.ts +18 -7
- package/src/google-generative-ai-options.ts +2 -0
- package/src/interactions/google-interactions-language-model-options.ts +2 -0
|
@@ -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
|
@@ -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
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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 (
|
|
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 & {});
|