@ai-sdk/google 3.0.123 → 3.0.125
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 +13 -0
- package/dist/index.js +25 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -22
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +24 -21
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +24 -21
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/google-generative-ai-language-model.ts +7 -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.125",
|
|
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.16",
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.52"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -392,10 +392,15 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
392
392
|
|
|
393
393
|
const candidate = response.candidates?.[0];
|
|
394
394
|
const promptBlockReason = response.promptFeedback?.blockReason;
|
|
395
|
+
const confirmedPromptBlockReason = isConfirmedPromptBlockReason(
|
|
396
|
+
promptBlockReason,
|
|
397
|
+
)
|
|
398
|
+
? promptBlockReason
|
|
399
|
+
: undefined;
|
|
395
400
|
const isPromptBlocked =
|
|
396
|
-
candidate?.finishReason == null &&
|
|
401
|
+
candidate?.finishReason == null && confirmedPromptBlockReason != null;
|
|
397
402
|
const rawFinishReason =
|
|
398
|
-
candidate?.finishReason ??
|
|
403
|
+
candidate?.finishReason ?? confirmedPromptBlockReason;
|
|
399
404
|
const content: Array<LanguageModelV3Content> = [];
|
|
400
405
|
|
|
401
406
|
// map ordered parts to content:
|