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

Add ui.MarkdownStream #1782

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Add ui.MarkdownStream #1782

wants to merge 15 commits into from

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Nov 21, 2024

This PR extracts the streaming markdown capabilities of ui.Chat() into another component: ui.MarkdownStream(). See the new files for example usage:

  • shiny/api-examples/MarkdownStream/app-express.py
  • shiny/api-examples/MarkdownStream/app-core.py

While extracting out the markdown streaming portion, I also improved the 'auto-scroll' behavior. Now it should be easier to disable/enable auto scroll by scrolling away/towards the bottom of a scrollable parent of the stream

TODO

  • Unit tests

Follow up

  • Make necessary shinychat changes to pull/incorporate new assets
  • Do we provide an R equivalent of ui.MarkdownStream()? If so, where should that live?

@cpsievert cpsievert force-pushed the markdown-stream-component branch from 026867b to ba86904 Compare November 26, 2024 18:08
@cpsievert cpsievert force-pushed the markdown-stream-component branch from a6f66a5 to 7cf0366 Compare January 27, 2025 20:52
Since .stream() has clear=True, it doesn't really serve any purpose
@cpsievert cpsievert force-pushed the markdown-stream-component branch from 4c7cbbc to c295a54 Compare January 28, 2025 17:35
@cpsievert cpsievert force-pushed the markdown-stream-component branch from c295a54 to b304ee2 Compare January 28, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants