@ai-sdk/google 3.0.73 → 3.0.75

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.d.mts +17 -0
  3. package/dist/index.d.ts +17 -0
  4. package/dist/index.js +521 -340
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +521 -340
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/internal/index.d.mts +1 -0
  9. package/dist/internal/index.d.ts +1 -0
  10. package/dist/internal/index.js +43 -28
  11. package/dist/internal/index.js.map +1 -1
  12. package/dist/internal/index.mjs +43 -28
  13. package/dist/internal/index.mjs.map +1 -1
  14. package/docs/15-google-generative-ai.mdx +72 -16
  15. package/package.json +1 -1
  16. package/src/convert-to-google-generative-ai-messages.ts +20 -2
  17. package/src/google-generative-ai-language-model.ts +5 -4
  18. package/src/google-generative-ai-prompt.ts +5 -1
  19. package/src/interactions/build-google-interactions-stream-transform.ts +285 -154
  20. package/src/interactions/convert-to-google-interactions-input.ts +57 -133
  21. package/src/interactions/extract-google-interactions-sources.ts +3 -3
  22. package/src/interactions/google-interactions-api.ts +179 -115
  23. package/src/interactions/google-interactions-language-model-options.ts +61 -0
  24. package/src/interactions/google-interactions-language-model.ts +100 -38
  25. package/src/interactions/google-interactions-prompt.ts +189 -114
  26. package/src/interactions/map-google-interactions-finish-reason.ts +3 -5
  27. package/src/interactions/parse-google-interactions-outputs.ts +80 -74
  28. package/src/interactions/prepare-google-interactions-tools.ts +1 -1
  29. package/src/interactions/stream-google-interactions.ts +1 -1
  30. package/src/interactions/synthesize-google-interactions-agent-stream.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.75
4
+
5
+ ### Patch Changes
6
+
7
+ - ab15576: feat(google): update Interactions API implementation to cater for upstream breaking changes coming May 26
8
+
9
+ ## 3.0.74
10
+
11
+ ### Patch Changes
12
+
13
+ - 3ca0daa: fix(provider/google): support `functionCall.id` when returned by Gemini API and provide matching `functionResponse.id`
14
+
3
15
  ## 3.0.73
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -49,6 +49,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
49
49
  content?: Record<string, never> | {
50
50
  parts?: ({
51
51
  functionCall: {
52
+ id?: string | null | undefined;
52
53
  name?: string | null | undefined;
53
54
  args?: unknown;
54
55
  partialArgs?: {
@@ -291,6 +292,22 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
291
292
  } | null | undefined;
292
293
  thinkingLevel?: "minimal" | "low" | "medium" | "high" | null | undefined;
293
294
  thinkingSummaries?: "auto" | "none" | null | undefined;
295
+ responseFormat?: ({
296
+ [x: string]: unknown;
297
+ type: "text";
298
+ mimeType?: string | null | undefined;
299
+ schema?: unknown;
300
+ } | {
301
+ [x: string]: unknown;
302
+ type: "image";
303
+ mimeType?: string | null | undefined;
304
+ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
305
+ imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
306
+ } | {
307
+ [x: string]: unknown;
308
+ type: "audio";
309
+ mimeType?: string | null | undefined;
310
+ })[] | null | undefined;
294
311
  imageConfig?: {
295
312
  aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
296
313
  imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
package/dist/index.d.ts CHANGED
@@ -49,6 +49,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
49
49
  content?: Record<string, never> | {
50
50
  parts?: ({
51
51
  functionCall: {
52
+ id?: string | null | undefined;
52
53
  name?: string | null | undefined;
53
54
  args?: unknown;
54
55
  partialArgs?: {
@@ -291,6 +292,22 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
291
292
  } | null | undefined;
292
293
  thinkingLevel?: "minimal" | "low" | "medium" | "high" | null | undefined;
293
294
  thinkingSummaries?: "auto" | "none" | null | undefined;
295
+ responseFormat?: ({
296
+ [x: string]: unknown;
297
+ type: "text";
298
+ mimeType?: string | null | undefined;
299
+ schema?: unknown;
300
+ } | {
301
+ [x: string]: unknown;
302
+ type: "image";
303
+ mimeType?: string | null | undefined;
304
+ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
305
+ imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
306
+ } | {
307
+ [x: string]: unknown;
308
+ type: "audio";
309
+ mimeType?: string | null | undefined;
310
+ })[] | null | undefined;
294
311
  imageConfig?: {
295
312
  aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
296
313
  imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;