Skip to content
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

Support for streaming messages #52

Closed
jtpio opened this issue Jun 10, 2024 · 5 comments
Closed

Support for streaming messages #52

jtpio opened this issue Jun 10, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@jtpio
Copy link
Member

jtpio commented Jun 10, 2024

Problem

Currently messages are added to the chat in one go. See this screencast as an example:

jupyterlab-codestral-demo-lite.webm

However most of the AI chat UIs stream responses to the user, for example:

mistral-ai-chat.webm

Proposed Solution

Add optional support for streaming messages, which could be enabled via the settings editor or by extensions.

Additional context

This would be useful for AI extensions using jupyter-chat for interacting with some online AI providers, such as https://github.com/jtpio/jupyterlab-codestral

@jtpio jtpio added the enhancement New feature or request label Jun 10, 2024
@jtpio
Copy link
Member Author

jtpio commented Jun 11, 2024

This might already be possible in some way by a plugin, by calling the updateMessage method:

/**
* Optional, to update a message from the chat panel.
*
* @param id - the unique ID of the message.
* @param message - the updated message.
*/
updateMessage?(
id: string,
message: IChatMessage
): Promise<boolean | void> | boolean | void;

@brichet
Copy link
Collaborator

brichet commented Jun 11, 2024

This might already be possible in some way by a plugin, by calling the updateMessage method:

Yes, this is possible but will call the RendermimeMarkdown for the whole content on every update.

To avoid this, we could find a way to tell the message component to append the new content to the DOM, using the appendContent flag:

(appendContent ? (
<div ref={node => node && node.appendChild(renderedContent)} />
) : (

@jtpio
Copy link
Member Author

jtpio commented Jun 17, 2024

Linking to jupyterlab/jupyter-ai#228 as related.

@dlqqq
Copy link
Member

dlqqq commented Dec 4, 2024

@brichet Can this issue be closed now? Seems like the update message PR makes this possible.

I'm not sure if there's a use-case for disabling message streaming; I think we can open another issue to track that if needed.

@brichet
Copy link
Collaborator

brichet commented Dec 4, 2024

Yes, this issue can be closed.

I'm not sure if there's a use-case for disabling message streaming; I think we can open another issue to track that if needed.

Currently, there is no concept of streaming in the chat extension. There is only a way to update a message.
I think that this concept is really related to generative AI stuff (correct me if I'm wrong), so a feature to disable message streaming would make more sense in jupyter-ai.

@brichet brichet closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants