ai 5.0.264 → 5.0.265

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/dist/index.mjs CHANGED
@@ -727,7 +727,7 @@ import {
727
727
  } from "@ai-sdk/provider-utils";
728
728
 
729
729
  // src/version.ts
730
- var VERSION = true ? "5.0.264" : "0.0.0-test";
730
+ var VERSION = true ? "5.0.265" : "0.0.0-test";
731
731
 
732
732
  // src/util/download/download.ts
733
733
  var download = async ({
@@ -1944,8 +1944,8 @@ var DefaultGeneratedFile = class {
1944
1944
  }
1945
1945
  };
1946
1946
  var DefaultGeneratedFileWithType = class extends DefaultGeneratedFile {
1947
- constructor(options) {
1948
- super(options);
1947
+ constructor() {
1948
+ super(...arguments);
1949
1949
  this.type = "file";
1950
1950
  }
1951
1951
  };
@@ -2923,8 +2923,6 @@ function writeToServerResponse({
2923
2923
  });
2924
2924
  }
2925
2925
  }
2926
- } catch (error) {
2927
- throw error;
2928
2926
  } finally {
2929
2927
  response.end();
2930
2928
  }
@@ -6592,7 +6590,6 @@ async function embedMany({
6592
6590
  }),
6593
6591
  tracer,
6594
6592
  fn: async (span) => {
6595
- var _a16;
6596
6593
  const [
6597
6594
  maxEmbeddingsPerCall,
6598
6595
  maxInputBytesPerCall,
@@ -6625,7 +6622,7 @@ async function embedMany({
6625
6622
  }),
6626
6623
  tracer,
6627
6624
  fn: async (doEmbedSpan) => {
6628
- var _a17;
6625
+ var _a16;
6629
6626
  const modelResponse = await model.doEmbed({
6630
6627
  values,
6631
6628
  abortSignal,
@@ -6633,7 +6630,7 @@ async function embedMany({
6633
6630
  providerOptions
6634
6631
  });
6635
6632
  const embeddings3 = modelResponse.embeddings;
6636
- const usage2 = (_a17 = modelResponse.usage) != null ? _a17 : { tokens: NaN };
6633
+ const usage2 = (_a16 = modelResponse.usage) != null ? _a16 : { tokens: NaN };
6637
6634
  doEmbedSpan.setAttributes(
6638
6635
  selectTelemetryAttributes({
6639
6636
  telemetry,
@@ -6711,7 +6708,7 @@ async function embedMany({
6711
6708
  }),
6712
6709
  tracer,
6713
6710
  fn: async (doEmbedSpan) => {
6714
- var _a17;
6711
+ var _a16;
6715
6712
  const modelResponse = await model.doEmbed({
6716
6713
  values: chunk,
6717
6714
  abortSignal,
@@ -6719,7 +6716,7 @@ async function embedMany({
6719
6716
  providerOptions
6720
6717
  });
6721
6718
  const embeddings2 = modelResponse.embeddings;
6722
- const usage = (_a17 = modelResponse.usage) != null ? _a17 : { tokens: NaN };
6719
+ const usage = (_a16 = modelResponse.usage) != null ? _a16 : { tokens: NaN };
6723
6720
  doEmbedSpan.setAttributes(
6724
6721
  selectTelemetryAttributes({
6725
6722
  telemetry,
@@ -6756,7 +6753,7 @@ async function embedMany({
6756
6753
  result.providerMetadata
6757
6754
  )) {
6758
6755
  providerMetadata[providerName] = {
6759
- ...(_a16 = providerMetadata[providerName]) != null ? _a16 : {},
6756
+ ...providerMetadata[providerName],
6760
6757
  ...metadata
6761
6758
  };
6762
6759
  }
@@ -10420,7 +10417,7 @@ async function safeValidateUIMessages({
10420
10417
  }
10421
10418
  if (metadataSchema) {
10422
10419
  for (const message of validatedMessages) {
10423
- await validateTypes2({
10420
+ message.metadata = await validateTypes2({
10424
10421
  value: message.metadata,
10425
10422
  schema: metadataSchema
10426
10423
  });
@@ -10443,7 +10440,7 @@ async function safeValidateUIMessages({
10443
10440
  })
10444
10441
  };
10445
10442
  }
10446
- await validateTypes2({
10443
+ dataPart.data = await validateTypes2({
10447
10444
  value: dataPart.data,
10448
10445
  schema: dataSchema
10449
10446
  });