@ai-sdk/google 4.0.0-beta.2 → 4.0.0-beta.4

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,18 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.0-beta.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 2edd14e: fix(provider/google): correctly mark reasoning files as such and fix related multi-turn errors
8
+
9
+ ## 4.0.0-beta.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [531251e]
14
+ - @ai-sdk/provider-utils@5.0.0-beta.1
15
+
3
16
  ## 4.0.0-beta.2
4
17
 
5
18
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -56,6 +56,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
56
56
  mimeType: string;
57
57
  data: string;
58
58
  };
59
+ thought?: boolean | null | undefined;
59
60
  thoughtSignature?: string | null | undefined;
60
61
  } | {
61
62
  executableCode?: {
package/dist/index.d.ts CHANGED
@@ -56,6 +56,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
56
56
  mimeType: string;
57
57
  data: string;
58
58
  };
59
+ thought?: boolean | null | undefined;
59
60
  thoughtSignature?: string | null | undefined;
60
61
  } | {
61
62
  executableCode?: {
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_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.2" : "0.0.0-test";
33
+ var VERSION = true ? "4.0.0-beta.4" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -447,6 +447,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
447
447
  mimeType: part.mediaType,
448
448
  data: (0, import_provider_utils4.convertToBase64)(part.data)
449
449
  },
450
+ ...(providerOpts == null ? void 0 : providerOpts.thought) === true ? { thought: true } : {},
450
451
  thoughtSignature
451
452
  };
452
453
  }
@@ -1092,13 +1093,16 @@ var GoogleGenerativeAILanguageModel = class {
1092
1093
  } : void 0
1093
1094
  });
1094
1095
  } else if ("inlineData" in part) {
1096
+ const hasThought = part.thought === true;
1097
+ const hasThoughtSignature = !!part.thoughtSignature;
1095
1098
  content.push({
1096
1099
  type: "file",
1097
1100
  data: part.inlineData.data,
1098
1101
  mediaType: part.inlineData.mimeType,
1099
- providerMetadata: part.thoughtSignature ? {
1102
+ providerMetadata: hasThought || hasThoughtSignature ? {
1100
1103
  [providerOptionsName]: {
1101
- thoughtSignature: part.thoughtSignature
1104
+ ...hasThought ? { thought: true } : {},
1105
+ ...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
1102
1106
  }
1103
1107
  } : void 0
1104
1108
  });
@@ -1319,16 +1323,19 @@ var GoogleGenerativeAILanguageModel = class {
1319
1323
  });
1320
1324
  currentReasoningBlockId = null;
1321
1325
  }
1322
- const thoughtSignatureMetadata = part.thoughtSignature ? {
1326
+ const hasThought = part.thought === true;
1327
+ const hasThoughtSignature = !!part.thoughtSignature;
1328
+ const fileMeta = hasThought || hasThoughtSignature ? {
1323
1329
  [providerOptionsName]: {
1324
- thoughtSignature: part.thoughtSignature
1330
+ ...hasThought ? { thought: true } : {},
1331
+ ...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
1325
1332
  }
1326
1333
  } : void 0;
1327
1334
  controller.enqueue({
1328
1335
  type: "file",
1329
1336
  mediaType: part.inlineData.mimeType,
1330
1337
  data: part.inlineData.data,
1331
- providerMetadata: thoughtSignatureMetadata
1338
+ providerMetadata: fileMeta
1332
1339
  });
1333
1340
  }
1334
1341
  }
@@ -1594,6 +1601,7 @@ var getContentSchema = () => import_v45.z.object({
1594
1601
  mimeType: import_v45.z.string(),
1595
1602
  data: import_v45.z.string()
1596
1603
  }),
1604
+ thought: import_v45.z.boolean().nullish(),
1597
1605
  thoughtSignature: import_v45.z.string().nullish()
1598
1606
  }),
1599
1607
  import_v45.z.object({