vercel / ai-chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel
https://chat.vercel.ai
Other
5.53k stars 1.63k forks source link

submitUserMessage has `any` type in chat-panel.tsx #317

Open alexfarrill opened 2 months ago

alexfarrill commented 2 months ago

I noticed that submitUserMessage has an any type after it gets exported through the createAI function in actions.tsx instead of its original type signature.

I noticed because it caused a bug in my application where I was calling submitUserMessage with the wrong number of arguments, since I unknowingly had no type checking against the actual function signature of submitUserMessage.

Is this behavior intentional, a known limitation, or a bug?

If it's possible to get the signature out the other end or even to get by passing the type to useActions as a type parameter, I think that would be an improvement.

Thanks for taking a look!