ai 4.2.3 → 4.2.4

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": "4.2.3",
3
+ "version": "4.2.4",
4
4
  "description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -1532,6 +1532,12 @@ function standardizePrompt({
1532
1532
  const messages = promptType === "ui-messages" ? convertToCoreMessages(prompt.messages, {
1533
1533
  tools
1534
1534
  }) : prompt.messages;
1535
+ if (messages.length === 0) {
1536
+ throw new InvalidPromptError({
1537
+ prompt,
1538
+ message: "messages must not be empty"
1539
+ });
1540
+ }
1535
1541
  const validationResult = safeValidateTypes({
1536
1542
  value: messages,
1537
1543
  schema: z7.array(coreMessageSchema)