vercel / ai-chatbot

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

Add error handling for failed response in PromptForm #330

Closed rudrodip closed 1 month ago

rudrodip commented 2 months ago

Fixes issue #329

The code changes in PromptForm component add error handling for failed responses when submitting user messages. If an error occurs during the submission process, a toast notification with the message "Failed to get response" will be displayed. This improvement ensures a better user experience by providing feedback in case of errors.

Before:

https://github.com/vercel/ai-chatbot/assets/77154365/81b6fbab-1fce-4a22-b498-113f9ea1ece2

After:

https://github.com/vercel/ai-chatbot/assets/77154365/05216b59-cc75-4167-9990-1b65f43b3667

vercel[bot] commented 2 months ago

@rudrodip is attempting to deploy a commit to the Uncurated Tests Team on Vercel.

A member of the Team first needs to authorize it.