@ai-sdk/google 4.0.5 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -35,8 +35,8 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@ai-sdk/provider": "4.0.1",
39
- "@ai-sdk/provider-utils": "5.0.3"
38
+ "@ai-sdk/provider-utils": "5.0.4",
39
+ "@ai-sdk/provider": "4.0.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "22.19.19",
@@ -10,6 +10,7 @@ import {
10
10
  isFullMediaType,
11
11
  resolveFullMediaType,
12
12
  resolveProviderReference,
13
+ secureJsonParse,
13
14
  } from '@ai-sdk/provider-utils';
14
15
  import type {
15
16
  GoogleContent,
@@ -468,7 +469,7 @@ export function convertToGoogleMessages(
468
469
  toolType: serverToolType,
469
470
  args:
470
471
  typeof part.input === 'string'
471
- ? JSON.parse(part.input)
472
+ ? secureJsonParse(part.input)
472
473
  : part.input,
473
474
  id: serverToolCallId,
474
475
  },
@@ -31,7 +31,7 @@ type GoogleEmbeddingConfig = {
31
31
  export class GoogleEmbeddingModel implements EmbeddingModelV4 {
32
32
  readonly specificationVersion = 'v4';
33
33
  readonly modelId: GoogleEmbeddingModelId;
34
- readonly maxEmbeddingsPerCall = 2048;
34
+ readonly maxEmbeddingsPerCall = 100;
35
35
  readonly supportsParallelCalls = true;
36
36
 
37
37
  private readonly config: GoogleEmbeddingConfig;
@@ -10,6 +10,7 @@ import {
10
10
  isFullMediaType,
11
11
  resolveFullMediaType,
12
12
  resolveProviderReference,
13
+ secureJsonParse,
13
14
  } from '@ai-sdk/provider-utils';
14
15
  import type {
15
16
  GoogleInteractionsContent,
@@ -376,7 +377,7 @@ function compactPromptForPreviousInteraction({
376
377
 
377
378
  function safeParseToolArgs(input: string): Record<string, unknown> {
378
379
  try {
379
- const parsed = JSON.parse(input);
380
+ const parsed = secureJsonParse(input);
380
381
  if (
381
382
  parsed != null &&
382
383
  typeof parsed === 'object' &&
@@ -2,3 +2,9 @@ export * from '../google-language-model';
2
2
  export * from '../google-speech-model';
3
3
  export { googleTools } from '../google-tools';
4
4
  export type { GoogleModelId } from '../google-language-model-options';
5
+ export {
6
+ GoogleInteractionsLanguageModel,
7
+ type GoogleInteractionsModelInput,
8
+ } from '../interactions/google-interactions-language-model';
9
+ export type { GoogleInteractionsModelId } from '../interactions/google-interactions-language-model-options';
10
+ export type { GoogleInteractionsAgentName } from '../interactions/google-interactions-agent';