@ai-sdk/google 3.0.88 → 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/CHANGELOG.md +9 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +2 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/convert-to-google-generative-ai-messages.ts +2 -2
- package/src/google-generative-ai-embedding-model.ts +1 -1
- package/src/interactions/convert-to-google-interactions-input.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.89",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ai-sdk/provider": "3.0.13",
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.36"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
44
44
|
"tsup": "^8",
|
|
45
45
|
"typescript": "5.8.3",
|
|
46
46
|
"zod": "3.25.76",
|
|
47
|
-
"@
|
|
48
|
-
"@ai-
|
|
47
|
+
"@ai-sdk/test-server": "1.0.6",
|
|
48
|
+
"@vercel/ai-tsconfig": "0.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -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
|
-
?
|
|
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 =
|
|
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 =
|
|
375
|
+
const parsed = secureJsonParse(input);
|
|
376
376
|
if (
|
|
377
377
|
parsed != null &&
|
|
378
378
|
typeof parsed === 'object' &&
|