@ai-sdk/google 4.0.0-beta.10 → 4.0.0-beta.12

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.0-beta.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [61753c3]
8
+ - @ai-sdk/provider-utils@5.0.0-beta.4
9
+
10
+ ## 4.0.0-beta.11
11
+
12
+ ### Patch Changes
13
+
14
+ - f7d4f01: feat(provider): add support for `reasoning-file` type for files that are part of reasoning
15
+ - Updated dependencies [f7d4f01]
16
+ - @ai-sdk/provider-utils@5.0.0-beta.3
17
+ - @ai-sdk/provider@4.0.0-beta.2
18
+
3
19
  ## 4.0.0-beta.10
4
20
 
5
21
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils16 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "4.0.0-beta.10" : "0.0.0-test";
33
+ var VERSION = true ? "4.0.0-beta.12" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -471,6 +471,21 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
471
471
  thoughtSignature
472
472
  };
473
473
  }
474
+ case "reasoning-file": {
475
+ if (part.data instanceof URL) {
476
+ throw new import_provider2.UnsupportedFunctionalityError({
477
+ functionality: "File data URLs in assistant messages are not supported"
478
+ });
479
+ }
480
+ return {
481
+ inlineData: {
482
+ mimeType: part.mediaType,
483
+ data: (0, import_provider_utils4.convertToBase64)(part.data)
484
+ },
485
+ thought: true,
486
+ thoughtSignature
487
+ };
488
+ }
474
489
  case "file": {
475
490
  if (part.data instanceof URL) {
476
491
  throw new import_provider2.UnsupportedFunctionalityError({
@@ -1131,13 +1146,12 @@ var GoogleGenerativeAILanguageModel = class {
1131
1146
  const hasThought = part.thought === true;
1132
1147
  const hasThoughtSignature = !!part.thoughtSignature;
1133
1148
  content.push({
1134
- type: "file",
1149
+ type: hasThought ? "reasoning-file" : "file",
1135
1150
  data: part.inlineData.data,
1136
1151
  mediaType: part.inlineData.mimeType,
1137
- providerMetadata: hasThought || hasThoughtSignature ? {
1152
+ providerMetadata: hasThoughtSignature ? {
1138
1153
  [providerOptionsName]: {
1139
- ...hasThought ? { thought: true } : {},
1140
- ...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
1154
+ thoughtSignature: part.thoughtSignature
1141
1155
  }
1142
1156
  } : void 0
1143
1157
  });
@@ -1361,14 +1375,13 @@ var GoogleGenerativeAILanguageModel = class {
1361
1375
  }
1362
1376
  const hasThought = part.thought === true;
1363
1377
  const hasThoughtSignature = !!part.thoughtSignature;
1364
- const fileMeta = hasThought || hasThoughtSignature ? {
1378
+ const fileMeta = hasThoughtSignature ? {
1365
1379
  [providerOptionsName]: {
1366
- ...hasThought ? { thought: true } : {},
1367
- ...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
1380
+ thoughtSignature: part.thoughtSignature
1368
1381
  }
1369
1382
  } : void 0;
1370
1383
  controller.enqueue({
1371
- type: "file",
1384
+ type: hasThought ? "reasoning-file" : "file",
1372
1385
  mediaType: part.inlineData.mimeType,
1373
1386
  data: part.inlineData.data,
1374
1387
  providerMetadata: fileMeta