@ai-sdk/google 3.0.68 → 3.0.70
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 +17 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +7 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/google-generative-ai-language-model.ts +1 -0
- package/src/google-prepare-tools.ts +6 -2
- package/src/interactions/convert-to-google-interactions-input.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.70",
|
|
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.10",
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.27"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -10,10 +10,12 @@ export function prepareTools({
|
|
|
10
10
|
tools,
|
|
11
11
|
toolChoice,
|
|
12
12
|
modelId,
|
|
13
|
+
isVertexProvider = false,
|
|
13
14
|
}: {
|
|
14
15
|
tools: LanguageModelV3CallOptions['tools'];
|
|
15
16
|
toolChoice?: LanguageModelV3CallOptions['toolChoice'];
|
|
16
17
|
modelId: GoogleGenerativeAIModelId;
|
|
18
|
+
isVertexProvider?: boolean;
|
|
17
19
|
}): {
|
|
18
20
|
tools:
|
|
19
21
|
| Array<
|
|
@@ -202,10 +204,12 @@ export function prepareTools({
|
|
|
202
204
|
mode: 'VALIDATED' | 'ANY' | 'NONE';
|
|
203
205
|
allowedFunctionNames?: string[];
|
|
204
206
|
};
|
|
205
|
-
includeServerSideToolInvocations
|
|
207
|
+
includeServerSideToolInvocations?: true;
|
|
206
208
|
} = {
|
|
207
209
|
functionCallingConfig: { mode: 'VALIDATED' },
|
|
208
|
-
|
|
210
|
+
...(!isVertexProvider && {
|
|
211
|
+
includeServerSideToolInvocations: true,
|
|
212
|
+
}),
|
|
209
213
|
};
|
|
210
214
|
|
|
211
215
|
if (toolChoice != null) {
|
|
@@ -164,6 +164,15 @@ export function convertToGoogleInteractionsInput({
|
|
|
164
164
|
? [{ type: 'text', text: part.text }]
|
|
165
165
|
: undefined,
|
|
166
166
|
});
|
|
167
|
+
} else if (part.type === 'file') {
|
|
168
|
+
const fileBlock = convertFilePartToContent({
|
|
169
|
+
part,
|
|
170
|
+
warnings,
|
|
171
|
+
mediaResolution,
|
|
172
|
+
});
|
|
173
|
+
if (fileBlock != null) {
|
|
174
|
+
content.push(fileBlock);
|
|
175
|
+
}
|
|
167
176
|
} else if (part.type === 'tool-call') {
|
|
168
177
|
const signature = part.providerOptions?.google?.signature as
|
|
169
178
|
| string
|