ai 4.0.37 → 4.0.38

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
@@ -1657,7 +1657,7 @@ function convertToCoreMessages(messages, options) {
1657
1657
  break;
1658
1658
  }
1659
1659
  case "assistant": {
1660
- if (toolInvocations == null) {
1660
+ if (toolInvocations == null || toolInvocations.length === 0) {
1661
1661
  coreMessages.push({ role: "assistant", content });
1662
1662
  break;
1663
1663
  }