ai 5.0.222 → 5.0.224

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.222" : "0.0.0-test";
730
+ var VERSION = true ? "5.0.224" : "0.0.0-test";
731
731
 
732
732
  // src/util/download/download.ts
733
733
  var download = async ({
@@ -4740,6 +4740,10 @@ function createOutputTransformStream(output) {
4740
4740
  }
4741
4741
  text2 += chunk.text;
4742
4742
  textChunk += chunk.text;
4743
+ if (chunk.text.length === 0 && chunk.providerMetadata != null) {
4744
+ controller.enqueue({ part: chunk, partialOutput: void 0 });
4745
+ return;
4746
+ }
4743
4747
  const result = await output.parsePartial({ text: text2 });
4744
4748
  if (result != null) {
4745
4749
  const currentJson = JSON.stringify(result.partial);
@@ -5264,7 +5268,7 @@ var DefaultStreamTextResult = class {
5264
5268
  break;
5265
5269
  }
5266
5270
  case "text-delta": {
5267
- if (chunk.delta.length > 0) {
5271
+ if (chunk.delta.length > 0 || chunk.providerMetadata != null) {
5268
5272
  controller.enqueue({
5269
5273
  type: "text-delta",
5270
5274
  id: chunk.id,