You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Be able to clear the error from useChat without calling reload or handleSubmit
Use Cases
I have a button to clear the chat window (which calls setMessages([])). However, if there was an error in the conversation, the error persists after clearing the messages. I'd like to be able to clear the error when I call my chatClear function, so the chat gets reset to a default state.
I can currently get around this by adding messages.length > 0 && error to display the error, but it would be cleaner if I could just clear it.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Feature Description
Be able to clear the error from useChat without calling reload or handleSubmit
Use Cases
I have a button to clear the chat window (which calls
setMessages([])
). However, if there was an error in the conversation, the error persists after clearing the messages. I'd like to be able to clear the error when I call mychatClear
function, so the chat gets reset to a default state.I can currently get around this by adding
messages.length > 0 && error
to display the error, but it would be cleaner if I could just clear it.Additional context
No response
The text was updated successfully, but these errors were encountered: