-
Notifications
You must be signed in to change notification settings - Fork 15
feat(pkg-py): Improvements for statically rendered messages #131
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
Conversation
722f8f6
to
76204bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves support for statically rendered messages in the shinychat
package by making two key changes: allowing ChatMessage()
construction outside Shiny sessions and expanding message type support for Chat.chat_ui()
.
- Enhances
ChatMessage()
construction to work outside of active Shiny sessions by usingget_current_session()
instead ofrequire_active_session()
- Updates
Chat.chat_ui(messages=...)
to accept any type supported bymessage_content()
function - Refactors multiple test apps to use the new
chat.ui(messages=...)
pattern instead of passing messages to theChat()
constructor
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
pkg-py/src/shinychat/_chat_types.py | Updates ChatMessage to handle session-less construction with fallback HTML processing |
pkg-py/src/shinychat/_chat.py | Simplifies chat_ui() function to use message_content() for message processing |
pkg-py/tests/playwright/chat/*/app.py | Refactors 5 test applications to use new chat.ui(messages=...) pattern |
pkg-py/CHANGELOG.md | Documents the new features in the unreleased section |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR adds 2 things:
Chat.chat_ui(messages=...)
now supports any type also supported bymessage_content()
ChatMessage()
can now be constructed outside of a Shiny session