@ai-sdk/google 4.0.6 → 4.0.7

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - c6f5e62: Prevent prototype pollution when synchronously parsing provider JSON inputs and expose `secureJsonParse` from provider-utils.
8
+ - bd8d172: Fix Google embedding batch size to respect the Gemini API limit of 100 requests per batch.
9
+ - Updated dependencies [c6f5e62]
10
+ - @ai-sdk/provider-utils@5.0.4
11
+
3
12
  ## 4.0.6
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "@ai-sdk/provider-utils";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "4.0.6" : "0.0.0-test";
10
+ var VERSION = true ? "4.0.7" : "0.0.0-test";
11
11
 
12
12
  // src/google-embedding-model.ts
13
13
  import {
@@ -119,7 +119,7 @@ var googleEmbeddingModelOptions = lazySchema2(
119
119
  var GoogleEmbeddingModel = class _GoogleEmbeddingModel {
120
120
  constructor(modelId, config) {
121
121
  this.specificationVersion = "v4";
122
- this.maxEmbeddingsPerCall = 2048;
122
+ this.maxEmbeddingsPerCall = 100;
123
123
  this.supportsParallelCalls = true;
124
124
  this.modelId = modelId;
125
125
  this.config = config;
@@ -434,7 +434,8 @@ import {
434
434
  getTopLevelMediaType,
435
435
  isFullMediaType,
436
436
  resolveFullMediaType,
437
- resolveProviderReference
437
+ resolveProviderReference,
438
+ secureJsonParse
438
439
  } from "@ai-sdk/provider-utils";
439
440
  var SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator";
440
441
  var dataUrlRegex = /^data:([^;,]+);base64,(.+)$/s;
@@ -752,7 +753,7 @@ function convertToGoogleMessages(prompt, options) {
752
753
  return {
753
754
  toolCall: {
754
755
  toolType: serverToolType,
755
- args: typeof part.input === "string" ? JSON.parse(part.input) : part.input,
756
+ args: typeof part.input === "string" ? secureJsonParse(part.input) : part.input,
756
757
  id: serverToolCallId
757
758
  },
758
759
  thoughtSignature: effectiveThoughtSignature
@@ -4686,7 +4687,8 @@ import {
4686
4687
  getTopLevelMediaType as getTopLevelMediaType2,
4687
4688
  isFullMediaType as isFullMediaType2,
4688
4689
  resolveFullMediaType as resolveFullMediaType2,
4689
- resolveProviderReference as resolveProviderReference2
4690
+ resolveProviderReference as resolveProviderReference2,
4691
+ secureJsonParse as secureJsonParse2
4690
4692
  } from "@ai-sdk/provider-utils";
4691
4693
  function convertToGoogleInteractionsInput({
4692
4694
  prompt,
@@ -4931,7 +4933,7 @@ function compactPromptForPreviousInteraction({
4931
4933
  }
4932
4934
  function safeParseToolArgs(input) {
4933
4935
  try {
4934
- const parsed = JSON.parse(input);
4936
+ const parsed = secureJsonParse2(input);
4935
4937
  if (parsed != null && typeof parsed === "object" && !Array.isArray(parsed)) {
4936
4938
  return parsed;
4937
4939
  }