-
Notifications
You must be signed in to change notification settings - Fork 4.2k
AI_InvalidPromptError: Invalid prompt: messages must be an array of CoreMessage or UIMessage #5499
Copy link
Copy link
Closed
Labels
ai/corecore functions like generateText, streamText, etc. Provider utils, and provider spec.core functions like generateText, streamText, etc. Provider utils, and provider spec.ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelrelated to a provider package. Must be assigned together with at least one `provider/*` labelbugSomething isn't working as documentedSomething isn't working as documentedprovider/openaiIssues related to the @ai-sdk/openai providerIssues related to the @ai-sdk/openai providerprovider/openai-compatibleIssues related to the @ai-sdk/openai-compatible providerIssues related to the @ai-sdk/openai-compatible provider
Metadata
Metadata
Assignees
Labels
ai/corecore functions like generateText, streamText, etc. Provider utils, and provider spec.core functions like generateText, streamText, etc. Provider utils, and provider spec.ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelrelated to a provider package. Must be assigned together with at least one `provider/*` labelbugSomething isn't working as documentedSomething isn't working as documentedprovider/openaiIssues related to the @ai-sdk/openai providerIssues related to the @ai-sdk/openai providerprovider/openai-compatibleIssues related to the @ai-sdk/openai-compatible providerIssues related to the @ai-sdk/openai-compatible provider
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
After upgrade the ai-sdks to the latest, the exact version are list below, can't get pass the zod validation.
partproperty https://github.com/vercel/ai/blob/main/packages/react/src/use-chat.ts#L465partproperty failed the zod validation, so I useconvertToCoreMessagesthis util to remove it, unfortunately still can't pass the validationpartof the user message was removed, but theassistantmessage is formatted to mismatch theCoreAssistantMessageCode example
AI provider
"@ai-sdk/provider": "^1.1.0",
Additional context