ai 7.0.6 → 7.0.7

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
+ ## 7.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - d598481: Fix: `convertToModelMessages` no longer emits an empty assistant message when a block contains only unknown data parts (e.g. a data part before `step-start` with no `convertDataPart` provided)
8
+
3
9
  ## 7.0.6
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1089,7 +1089,7 @@ import {
1089
1089
  } from "@ai-sdk/provider-utils";
1090
1090
 
1091
1091
  // src/version.ts
1092
- var VERSION = true ? "7.0.6" : "0.0.0-test";
1092
+ var VERSION = true ? "7.0.7" : "0.0.0-test";
1093
1093
 
1094
1094
  // src/util/download/download.ts
1095
1095
  var download = async ({
@@ -10458,10 +10458,12 @@ async function convertToModelMessages(messages, options) {
10458
10458
  throw new Error(`Unsupported part: ${_exhaustiveCheck}`);
10459
10459
  }
10460
10460
  }
10461
- modelMessages.push({
10462
- role: "assistant",
10463
- content
10464
- });
10461
+ if (content.length > 0) {
10462
+ modelMessages.push({
10463
+ role: "assistant",
10464
+ content
10465
+ });
10466
+ }
10465
10467
  const toolParts = block.filter(
10466
10468
  (part) => {
10467
10469
  var _a23;