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

CopytoClipboardButton does not work when streaming #408

Closed
nenb opened this issue May 8, 2024 · 2 comments · Fixed by #411
Closed

CopytoClipboardButton does not work when streaming #408

nenb opened this issue May 8, 2024 · 2 comments · Fixed by #411
Labels
type: bug 🐛 Something isn't working

Comments

@nenb
Copy link
Contributor

nenb commented May 8, 2024

Bug description

When I try to copy a response to the clipboard when streaming, at most 1 letter seems to be selected.

It appears to work correctly when using the demo assistants (where there is no streaming).

How to reproduce the bug?

Select an assistant that involves streaming and try to copy the response with the button.

Versions and dependencies used

No response

Anything else?

The logic is contained in central_view.py. A ReactiveHTML component is created for CopyToClipboardButton. I think that when we are streaming, we are not passing the full value to this component.

@nenb nenb added the type: bug 🐛 Something isn't working label May 8, 2024
@pmeier
Copy link
Member

pmeier commented May 9, 2024

I don't think we have ever selected a correct behavior here. I think there are two options:

  1. Copy whatever message fragment is already there
  2. Disable the copy button until streaming is done and afterwards copy the whole message

Of those two I would prefer 2. But we should look around how others, i.e. OpenAI / Anthropic / ..., handle this. No need to diverge here if there is an established behavior.

@nenb
Copy link
Contributor Author

nenb commented May 9, 2024

@pmeier OpenAI follow 2. I would also prefer 2 for performance reasons with panel.

I can open a short PR later if 2 is okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants