ai 3.1.29 → 3.1.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "3.1.29",
3
+ "version": "3.1.30",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -358,7 +358,13 @@ function convertToLanguageModelMessage(message) {
358
358
  content: [{ type: "text", text: message.content }]
359
359
  };
360
360
  }
361
- return { role: "assistant", content: message.content };
361
+ return {
362
+ role: "assistant",
363
+ content: message.content.filter(
364
+ // remove empty text parts:
365
+ (part) => part.type !== "text" || part.text !== ""
366
+ )
367
+ };
362
368
  }
363
369
  case "tool": {
364
370
  return message;