@ai-sdk/google
Advanced tools
+6
-0
| # @ai-sdk/google | ||
| ## 3.0.45 | ||
| ### Patch Changes | ||
| - e2a59ef: fix(provider/google): preserve groundingMetadata and urlContextMetadata when they arrive in a stream chunk before the finishReason chunk | ||
| ## 3.0.44 | ||
@@ -4,0 +10,0 @@ |
@@ -1011,2 +1011,4 @@ "use strict"; | ||
| let providerMetadata = void 0; | ||
| let lastGroundingMetadata = null; | ||
| let lastUrlContextMetadata = null; | ||
| const generateId2 = this.config.generateId; | ||
@@ -1026,3 +1028,3 @@ let hasToolCalls = false; | ||
| transform(chunk, controller) { | ||
| var _a, _b, _c, _d, _e, _f, _g, _h; | ||
| var _a, _b, _c, _d, _e, _f; | ||
| if (options.includeRawChunks) { | ||
@@ -1045,2 +1047,8 @@ controller.enqueue({ type: "raw", rawValue: chunk.rawValue }); | ||
| const content = candidate.content; | ||
| if (candidate.groundingMetadata != null) { | ||
| lastGroundingMetadata = candidate.groundingMetadata; | ||
| } | ||
| if (candidate.urlContextMetadata != null) { | ||
| lastUrlContextMetadata = candidate.urlContextMetadata; | ||
| } | ||
| const sources = extractSources({ | ||
@@ -1219,5 +1227,5 @@ groundingMetadata: candidate.groundingMetadata, | ||
| promptFeedback: (_e = value.promptFeedback) != null ? _e : null, | ||
| groundingMetadata: (_f = candidate.groundingMetadata) != null ? _f : null, | ||
| urlContextMetadata: (_g = candidate.urlContextMetadata) != null ? _g : null, | ||
| safetyRatings: (_h = candidate.safetyRatings) != null ? _h : null | ||
| groundingMetadata: lastGroundingMetadata, | ||
| urlContextMetadata: lastUrlContextMetadata, | ||
| safetyRatings: (_f = candidate.safetyRatings) != null ? _f : null | ||
| } | ||
@@ -1224,0 +1232,0 @@ }; |
@@ -1000,2 +1000,4 @@ // src/google-generative-ai-language-model.ts | ||
| let providerMetadata = void 0; | ||
| let lastGroundingMetadata = null; | ||
| let lastUrlContextMetadata = null; | ||
| const generateId2 = this.config.generateId; | ||
@@ -1015,3 +1017,3 @@ let hasToolCalls = false; | ||
| transform(chunk, controller) { | ||
| var _a, _b, _c, _d, _e, _f, _g, _h; | ||
| var _a, _b, _c, _d, _e, _f; | ||
| if (options.includeRawChunks) { | ||
@@ -1034,2 +1036,8 @@ controller.enqueue({ type: "raw", rawValue: chunk.rawValue }); | ||
| const content = candidate.content; | ||
| if (candidate.groundingMetadata != null) { | ||
| lastGroundingMetadata = candidate.groundingMetadata; | ||
| } | ||
| if (candidate.urlContextMetadata != null) { | ||
| lastUrlContextMetadata = candidate.urlContextMetadata; | ||
| } | ||
| const sources = extractSources({ | ||
@@ -1208,5 +1216,5 @@ groundingMetadata: candidate.groundingMetadata, | ||
| promptFeedback: (_e = value.promptFeedback) != null ? _e : null, | ||
| groundingMetadata: (_f = candidate.groundingMetadata) != null ? _f : null, | ||
| urlContextMetadata: (_g = candidate.urlContextMetadata) != null ? _g : null, | ||
| safetyRatings: (_h = candidate.safetyRatings) != null ? _h : null | ||
| groundingMetadata: lastGroundingMetadata, | ||
| urlContextMetadata: lastUrlContextMetadata, | ||
| safetyRatings: (_f = candidate.safetyRatings) != null ? _f : null | ||
| } | ||
@@ -1213,0 +1221,0 @@ }; |
+3
-3
| { | ||
| "name": "@ai-sdk/google", | ||
| "version": "3.0.44", | ||
| "version": "3.0.45", | ||
| "license": "Apache-2.0", | ||
@@ -47,4 +47,4 @@ "sideEffects": false, | ||
| "zod": "3.25.76", | ||
| "@vercel/ai-tsconfig": "0.0.0", | ||
| "@ai-sdk/test-server": "1.0.3" | ||
| "@ai-sdk/test-server": "1.0.3", | ||
| "@vercel/ai-tsconfig": "0.0.0" | ||
| }, | ||
@@ -51,0 +51,0 @@ "peerDependencies": { |
@@ -391,2 +391,4 @@ import { | ||
| let providerMetadata: SharedV3ProviderMetadata | undefined = undefined; | ||
| let lastGroundingMetadata: GroundingMetadataSchema | null = null; | ||
| let lastUrlContextMetadata: UrlContextMetadataSchema | null = null; | ||
@@ -443,2 +445,9 @@ const generateId = this.config.generateId; | ||
| if (candidate.groundingMetadata != null) { | ||
| lastGroundingMetadata = candidate.groundingMetadata; | ||
| } | ||
| if (candidate.urlContextMetadata != null) { | ||
| lastUrlContextMetadata = candidate.urlContextMetadata; | ||
| } | ||
| const sources = extractSources({ | ||
@@ -656,4 +665,4 @@ groundingMetadata: candidate.groundingMetadata, | ||
| promptFeedback: value.promptFeedback ?? null, | ||
| groundingMetadata: candidate.groundingMetadata ?? null, | ||
| urlContextMetadata: candidate.urlContextMetadata ?? null, | ||
| groundingMetadata: lastGroundingMetadata, | ||
| urlContextMetadata: lastUrlContextMetadata, | ||
| safetyRatings: candidate.safetyRatings ?? null, | ||
@@ -660,0 +669,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1090980
0.34%12111
0.33%