@ai-sdk/google 4.0.89 → 4.0.91
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 +14 -0
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +10 -7
- package/dist/internal/index.js.map +1 -1
- package/package.json +3 -3
- package/src/convert-to-google-messages.ts +14 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.91",
|
|
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.
|
|
39
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
38
|
+
"@ai-sdk/provider": "4.0.24",
|
|
39
|
+
"@ai-sdk/provider-utils": "5.0.56"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ai-sdk/test-server": "2.0.4",
|
|
@@ -689,6 +689,10 @@ export function convertToGoogleMessages(
|
|
|
689
689
|
);
|
|
690
690
|
}
|
|
691
691
|
} else {
|
|
692
|
+
const isError =
|
|
693
|
+
output.type === 'error-text' ||
|
|
694
|
+
output.type === 'error-json' ||
|
|
695
|
+
output.type === 'execution-denied';
|
|
692
696
|
parts.push({
|
|
693
697
|
functionResponse: {
|
|
694
698
|
...(includeFunctionCallIds && part.toolCallId != null
|
|
@@ -697,10 +701,16 @@ export function convertToGoogleMessages(
|
|
|
697
701
|
name: part.toolName,
|
|
698
702
|
response: {
|
|
699
703
|
name: part.toolName,
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
+
...(isError
|
|
705
|
+
? {
|
|
706
|
+
error:
|
|
707
|
+
output.type === 'execution-denied'
|
|
708
|
+
? (output.reason ?? 'Tool call execution denied.')
|
|
709
|
+
: serializeFunctionResponseContent(output.value),
|
|
710
|
+
}
|
|
711
|
+
: {
|
|
712
|
+
content: serializeFunctionResponseContent(output.value),
|
|
713
|
+
}),
|
|
704
714
|
},
|
|
705
715
|
},
|
|
706
716
|
});
|