@ai-sdk/google 3.0.87 → 3.0.89

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.87",
3
+ "version": "3.0.89",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@ai-sdk/provider": "3.0.13",
40
- "@ai-sdk/provider-utils": "4.0.34"
40
+ "@ai-sdk/provider-utils": "4.0.36"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -3,7 +3,7 @@ import {
3
3
  type LanguageModelV3Prompt,
4
4
  type SharedV3Warning,
5
5
  } from '@ai-sdk/provider';
6
- import { convertToBase64 } from '@ai-sdk/provider-utils';
6
+ import { convertToBase64, secureJsonParse } from '@ai-sdk/provider-utils';
7
7
  import type {
8
8
  GoogleGenerativeAIContent,
9
9
  GoogleGenerativeAIContentPart,
@@ -385,7 +385,7 @@ export function convertToGoogleGenerativeAIMessages(
385
385
  toolType: serverToolType,
386
386
  args:
387
387
  typeof part.input === 'string'
388
- ? JSON.parse(part.input)
388
+ ? secureJsonParse(part.input)
389
389
  : part.input,
390
390
  id: serverToolCallId,
391
391
  },
@@ -29,7 +29,7 @@ type GoogleGenerativeAIEmbeddingConfig = {
29
29
  export class GoogleGenerativeAIEmbeddingModel implements EmbeddingModelV3 {
30
30
  readonly specificationVersion = 'v3';
31
31
  readonly modelId: GoogleGenerativeAIEmbeddingModelId;
32
- readonly maxEmbeddingsPerCall = 2048;
32
+ readonly maxEmbeddingsPerCall = 100;
33
33
  readonly supportsParallelCalls = true;
34
34
 
35
35
  private readonly config: GoogleGenerativeAIEmbeddingConfig;
@@ -4,7 +4,7 @@ import type {
4
4
  LanguageModelV3ToolResultOutput,
5
5
  SharedV3Warning,
6
6
  } from '@ai-sdk/provider';
7
- import { convertToBase64 } from '@ai-sdk/provider-utils';
7
+ import { convertToBase64, secureJsonParse } from '@ai-sdk/provider-utils';
8
8
  import type {
9
9
  GoogleInteractionsContent,
10
10
  GoogleInteractionsContentBlock,
@@ -372,7 +372,7 @@ function compactPromptForPreviousInteraction({
372
372
 
373
373
  function safeParseToolArgs(input: string): Record<string, unknown> {
374
374
  try {
375
- const parsed = JSON.parse(input);
375
+ const parsed = secureJsonParse(input);
376
376
  if (
377
377
  parsed != null &&
378
378
  typeof parsed === 'object' &&