AI_InvalidPromptError
Learn how to fix AI_InvalidPromptError
This error occurs when the prompt provided is invalid.
Potential Causes
UI Messages
You are passing a UIMessage[] as messages into e.g. streamText.
You need to first convert them to a ModelMessage[] using convertToModelMessages().
Properties
prompt: The invalid prompt valuemessage: The error message (required in constructor)cause: The cause of the error (optional)
Checking for this Error
You can check if an error is an instance of AI_InvalidPromptError using: