ai 6.0.0-beta.32 → 6.0.0-beta.33

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
+ ## 6.0.0-beta.33
4
+
5
+ ### Patch Changes
6
+
7
+ - f733285: fix(ai): only parse experimental_output in generateText when finishReason is stop
8
+
3
9
  ## 6.0.0-beta.32
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -819,7 +819,7 @@ function detectMediaType({
819
819
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
820
820
 
821
821
  // src/version.ts
822
- var VERSION = true ? "6.0.0-beta.32" : "0.0.0-test";
822
+ var VERSION = true ? "6.0.0-beta.33" : "0.0.0-test";
823
823
 
824
824
  // src/util/download/download.ts
825
825
  var download = async ({ url }) => {
@@ -2870,17 +2870,21 @@ async function generateText({
2870
2870
  steps,
2871
2871
  totalUsage
2872
2872
  }));
2873
- return new DefaultGenerateTextResult({
2874
- steps,
2875
- totalUsage,
2876
- resolvedOutput: await (output == null ? void 0 : output.parseOutput(
2873
+ let resolvedOutput;
2874
+ if (lastStep.finishReason === "stop") {
2875
+ resolvedOutput = await (output == null ? void 0 : output.parseOutput(
2877
2876
  { text: lastStep.text },
2878
2877
  {
2879
2878
  response: lastStep.response,
2880
2879
  usage: lastStep.usage,
2881
2880
  finishReason: lastStep.finishReason
2882
2881
  }
2883
- ))
2882
+ ));
2883
+ }
2884
+ return new DefaultGenerateTextResult({
2885
+ steps,
2886
+ totalUsage,
2887
+ resolvedOutput
2884
2888
  });
2885
2889
  }
2886
2890
  });