jupyter-ai
jupyter-ai copied to clipboard
[v3.0.0rcx] Deleting messages breaks future replies
trafficstars
Testing the Jupyter AI 3.0.0.a0 prerelease and the behavior of deleting messages.
Description
There are a couple of issues in how chat works when you delete messages.
First, create a new chat with Jupyter AI configured. It will reply as expected:
Now click the trashcan button in your message to delete it. This deletes both the human message and the AI message following it.
Now reload the page, and you will see that the human message remains deleted, but the AI message has returned:
Now, with a human message in the deleted state, try another chat message to the AI. Jupyter AI throws an exceptions in the chat windows:
The interesting pieces is the last line of the traceback:
botocore.exceptions.EventStreamError: An error occurred (validationException) when calling the InvokeModelWithResponseStream operation: messages.0: all messages must have non-empty content except for the optional final assistant message
Expected behavior
- As a user, I want to delete AI messages separate from those that I type.
- As a user, if I delete an AI message, I want it to always be deleted in the future (across opening/closing the document or reloading the page).
- As a user, I want chat with AI to work, even when humans have deleted messages.
Context
Using the following conda environment:
name: jupyter-ai-testing
dependencies:
- python
- pip:
- jupyterlab==4.2.5
- jupyter-ai==3.0.0a0
- langchain-aws