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.
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