ai 4.2.6 → 4.2.8

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
@@ -1669,13 +1669,24 @@ function convertToCoreMessages(messages, options) {
1669
1669
  break;
1670
1670
  }
1671
1671
  case "user": {
1672
- coreMessages.push({
1673
- role: "user",
1674
- content: experimental_attachments ? [
1675
- { type: "text", text: content },
1676
- ...attachmentsToParts(experimental_attachments)
1677
- ] : content
1678
- });
1672
+ if (message.parts == null) {
1673
+ coreMessages.push({
1674
+ role: "user",
1675
+ content: experimental_attachments ? [
1676
+ { type: "text", text: content },
1677
+ ...attachmentsToParts(experimental_attachments)
1678
+ ] : content
1679
+ });
1680
+ } else {
1681
+ const textParts = message.parts.filter((part) => part.type === "text").map((part) => ({
1682
+ type: "text",
1683
+ text: part.text
1684
+ }));
1685
+ coreMessages.push({
1686
+ role: "user",
1687
+ content: experimental_attachments ? [...textParts, ...attachmentsToParts(experimental_attachments)] : textParts
1688
+ });
1689
+ }
1679
1690
  break;
1680
1691
  }
1681
1692
  case "assistant": {
@@ -6514,7 +6525,7 @@ function appendResponseMessages({
6514
6525
  }));
6515
6526
  };
6516
6527
  var getToolInvocations = getToolInvocations2;
6517
- const parts = [];
6528
+ const parts = [{ type: "step-start" }];
6518
6529
  let textContent = "";
6519
6530
  let reasoningTextContent = void 0;
6520
6531
  if (typeof message.content === "string") {