ai 4.1.49 → 4.1.50

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,11 @@
1
1
  # ai
2
2
 
3
+ ## 4.1.50
4
+
5
+ ### Patch Changes
6
+
7
+ - ae98f0d: fix (ai/core): forward providerOptions for text, image, and file parts
8
+
3
9
  ## 4.1.49
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1326,12 +1326,12 @@ async function downloadAssets(messages, downloadImplementation, modelSupportsIma
1326
1326
  );
1327
1327
  }
1328
1328
  function convertPartToLanguageModelPart(part, downloadedAssets) {
1329
- var _a16;
1329
+ var _a16, _b, _c, _d;
1330
1330
  if (part.type === "text") {
1331
1331
  return {
1332
1332
  type: "text",
1333
1333
  text: part.text,
1334
- providerMetadata: part.experimental_providerMetadata
1334
+ providerMetadata: (_a16 = part.providerOptions) != null ? _a16 : part.experimental_providerMetadata
1335
1335
  };
1336
1336
  }
1337
1337
  let mimeType = part.mimeType;
@@ -1379,13 +1379,13 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
1379
1379
  switch (type) {
1380
1380
  case "image": {
1381
1381
  if (normalizedData instanceof Uint8Array) {
1382
- mimeType = (_a16 = detectImageMimeType(normalizedData)) != null ? _a16 : mimeType;
1382
+ mimeType = (_b = detectImageMimeType(normalizedData)) != null ? _b : mimeType;
1383
1383
  }
1384
1384
  return {
1385
1385
  type: "image",
1386
1386
  image: normalizedData,
1387
1387
  mimeType,
1388
- providerMetadata: part.experimental_providerMetadata
1388
+ providerMetadata: (_c = part.providerOptions) != null ? _c : part.experimental_providerMetadata
1389
1389
  };
1390
1390
  }
1391
1391
  case "file": {
@@ -1396,7 +1396,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
1396
1396
  type: "file",
1397
1397
  data: normalizedData instanceof Uint8Array ? convertDataContentToBase64String(normalizedData) : normalizedData,
1398
1398
  mimeType,
1399
- providerMetadata: part.experimental_providerMetadata
1399
+ providerMetadata: (_d = part.providerOptions) != null ? _d : part.experimental_providerMetadata
1400
1400
  };
1401
1401
  }
1402
1402
  }