Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pop user message from multiturn if error is encountered (#198)
If a user has multiturn enabled but encounters an error, they are permanently stuck in a state where there are 2+ consecutive user messages in the conversation which prevents them from using the app at all unless they reload the page. One option to fix this is to only save messages if the content can be successfully parsed. As such, if an error is encountered and we couldn't parse the assistant message, we remove the user message from the Streamlit session state. Here is an example of the behavior, locally I've forced the API call to intermittently return an error. Note that we run into an error but are able to send later messages successfully, preserving multiturn context: https://github.com/user-attachments/assets/07d37267-0205-4812-aed9-5c86a8f8afcb Single-turn example: https://github.com/user-attachments/assets/b1baa51d-9276-4a33-9008-11137d542329
- Loading branch information