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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # ai
2
2
 
3
+ ## 4.0.38
4
+
5
+ ### Patch Changes
6
+
7
+ - 0118fa7: fix (ai/core): handle empty tool invocation array in convertToCoreMessages
8
+
3
9
  ## 4.0.37
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1717,7 +1717,7 @@ function convertToCoreMessages(messages, options) {
1717
1717
  break;
1718
1718
  }
1719
1719
  case "assistant": {
1720
- if (toolInvocations == null) {
1720
+ if (toolInvocations == null || toolInvocations.length === 0) {
1721
1721
  coreMessages.push({ role: "assistant", content });
1722
1722
  break;
1723
1723
  }