@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.68",
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.26"
40
+ "@ai-sdk/provider-utils": "4.0.27"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -181,6 +181,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
181
181
  tools,
182
182
  toolChoice,
183
183
  modelId: this.modelId,
184
+ isVertexProvider,
184
185
  });
185
186
 
186
187
  const streamFunctionCallArguments =
@@ -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: true;
207
+ includeServerSideToolInvocations?: true;
206
208
  } = {
207
209
  functionCallingConfig: { mode: 'VALIDATED' },
208
- includeServerSideToolInvocations: true,
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