Allow pressing `escape` to cancel the current assistant generation (#10987)

If the assistant has already emitted some text, we will leave the
assistant message but maintain the cursor on the previous user message,
so that the user can easily discard the message by submitting again.

If no output was emitted yet, we simply delete the empty assistant
message.

Release Notes:

- N/A
530224527dAntonio Scandurra committed on 4/25/2024, 1:12:58 PM· committed by GitHubparent0de2636
2 files changedLine totals unavailable