@ai-sdk/google 3.0.96 → 3.0.98
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 +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +3 -2
- package/dist/internal/index.d.ts +3 -2
- package/dist/internal/index.js +13 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +13 -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/google-generative-ai-language-model.ts +13 -1
- 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
|
@@ -548,7 +548,8 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
548
548
|
},
|
|
549
549
|
request: { body: args },
|
|
550
550
|
response: {
|
|
551
|
-
// TODO timestamp, model id
|
|
551
|
+
// TODO timestamp, model id
|
|
552
|
+
id: response.responseId ?? undefined,
|
|
552
553
|
headers: responseHeaders,
|
|
553
554
|
body: rawResponse,
|
|
554
555
|
},
|
|
@@ -590,6 +591,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
590
591
|
|
|
591
592
|
const generateId = this.config.generateId;
|
|
592
593
|
let hasToolCalls = false;
|
|
594
|
+
let hasEmittedResponseMetadata = false;
|
|
593
595
|
|
|
594
596
|
// Track active blocks to group consecutive parts of same type
|
|
595
597
|
let currentTextBlockId: string | null = null;
|
|
@@ -668,6 +670,14 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
668
670
|
|
|
669
671
|
const value = chunk.value;
|
|
670
672
|
|
|
673
|
+
if (!hasEmittedResponseMetadata && value.responseId != null) {
|
|
674
|
+
hasEmittedResponseMetadata = true;
|
|
675
|
+
controller.enqueue({
|
|
676
|
+
type: 'response-metadata',
|
|
677
|
+
id: value.responseId,
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
|
|
671
681
|
const usageMetadata = value.usageMetadata;
|
|
672
682
|
|
|
673
683
|
if (usageMetadata != null) {
|
|
@@ -1452,6 +1462,7 @@ export const getUrlContextMetadataSchema = () =>
|
|
|
1452
1462
|
const responseSchema = lazySchema(() =>
|
|
1453
1463
|
zodSchema(
|
|
1454
1464
|
z.object({
|
|
1465
|
+
responseId: z.string().nullish(),
|
|
1455
1466
|
candidates: z.array(
|
|
1456
1467
|
z.object({
|
|
1457
1468
|
content: getContentSchema().nullish().or(z.object({}).strict()),
|
|
@@ -1505,6 +1516,7 @@ export type UsageMetadataSchema = NonNullable<
|
|
|
1505
1516
|
const chunkSchema = lazySchema(() =>
|
|
1506
1517
|
zodSchema(
|
|
1507
1518
|
z.object({
|
|
1519
|
+
responseId: z.string().nullish(),
|
|
1508
1520
|
candidates: z
|
|
1509
1521
|
.array(
|
|
1510
1522
|
z.object({
|
|
@@ -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 & {});
|