-
-
Notifications
You must be signed in to change notification settings - Fork 13
FR: Modular message footer API #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @dlqqq for the detailed issue.
Currently the chat is aware of people writing using the
The same awareness is used in Jupyter AI when streaming a response: https://github.com/jupyterlab/jupyter-ai/blob/304d9f8611b6b7dea25eeb0a45ab94787ea48eef/packages/jupyter-ai/jupyter_ai/chat_handlers/utils/streaming.py#L47. The type of |
I opened #208 to retrieve the message ID that the writer is editing (between other features). |
Also opened #210 to add the message footers.
IIUC, I don't think that this is possible, a token can be provided by only one extension. This is why I choose to provide a registry instead. |
Problem
Upstream issue in Jupyter AI: jupyterlab/jupyter-ai#1297
#198 adds a new feature that allows Jupyter Chat to replicate the "Stop streaming" capability in Jupyter AI v2. Thank you all for working on this! 🤗
However, I think that we should also explore other ways of allowing users to stop streaming messages. Users should be able to send messages regardless of whether an AI is streaming a reply to this user. The UI in Jupyter AI v2 made sense because it was just one user w/ one AI back then, but it doesn't scale well to many users w/ many AIs.
Here, I propose building a modular message footer API to:
The reason I seek 2) is because other labextensions may want to add message footers as well. This feature was added in Jupyter AI 2.x for other applications to provide custom UI elements to each message. For example, some developers have used this API to render thumbs up / thumbs down buttons to allow users to "rate" an AI response.
Proposed design
ChatMessageFooter
token. When other plugins provide this, they have to provide a React component that renders their footer, and pick a location to render. The React component accepts the current message & position as props. The location can be "left", "right", or "center".If 2 plugins provide the same footer at the same location, we can just pick 1 arbitrarily. The idea is that if one labextension is occupying the 'center' position, another labextension can render their footer on the 'left' or 'right' position. Therefore these conflicts should not happen to begin with.
footers
object above in a flexbox, like this:This design thus allows up to 3 extensions adding 3 different footers, and makes the footer component fully customizable. Jupyter Chat will only control what props are passed to each message footer component.
Additional context
@brichet Jupyter AI also needs some way of setting metadata on each message to indicate whether it is complete or still streaming. We will need this data to know when to show/hide the "Stop streaming" button. Do you know if this is possible in Jupyter Chat?
The text was updated successfully, but these errors were encountered: