ai 4.2.3 → 4.2.5

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
@@ -2101,6 +2101,12 @@ function standardizePrompt({
2101
2101
  const messages = promptType === "ui-messages" ? convertToCoreMessages(prompt.messages, {
2102
2102
  tools
2103
2103
  }) : prompt.messages;
2104
+ if (messages.length === 0) {
2105
+ throw new InvalidPromptError({
2106
+ prompt,
2107
+ message: "messages must not be empty"
2108
+ });
2109
+ }
2104
2110
  const validationResult = safeValidateTypes({
2105
2111
  value: messages,
2106
2112
  schema: z7.array(coreMessageSchema)