@ai-sdk/google 4.0.6 → 4.0.8
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 +18 -0
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +6 -4
- package/dist/internal/index.js.map +1 -1
- package/package.json +5 -5
- package/src/convert-to-google-messages.ts +2 -1
- package/src/google-embedding-model.ts +1 -1
- package/src/interactions/convert-to-google-interactions-input.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
39
|
-
"@ai-sdk/provider": "4.0.
|
|
38
|
+
"@ai-sdk/provider-utils": "5.0.5",
|
|
39
|
+
"@ai-sdk/provider": "4.0.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "22.19.19",
|
|
43
43
|
"tsup": "^8.5.1",
|
|
44
44
|
"typescript": "5.8.3",
|
|
45
45
|
"zod": "3.25.76",
|
|
46
|
-
"@ai-
|
|
47
|
-
"@
|
|
46
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
47
|
+
"@ai-sdk/test-server": "2.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -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
|
-
?
|
|
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 =
|
|
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 =
|
|
380
|
+
const parsed = secureJsonParse(input);
|
|
380
381
|
if (
|
|
381
382
|
parsed != null &&
|
|
382
383
|
typeof parsed === 'object' &&
|