-
-
Notifications
You must be signed in to change notification settings - Fork 571
Add Streamlit Chat Migration Guide #5642
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
Codecov Report
@@ Coverage Diff @@
## main #5642 +/- ##
==========================================
- Coverage 83.65% 83.61% -0.05%
==========================================
Files 280 288 +8
Lines 41580 41678 +98
==========================================
+ Hits 34782 34847 +65
- Misses 6798 6831 +33
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
|
||
| Below we will show you how to build a custom `ChatInput` widget. | ||
|
|
||
| ```python |
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.
Should we add a component like this to Panels chat components @ahuang11 and @philippjfr ?
|
|
||
| Below we will show you how to build a custom `ChatInput` widget. | ||
|
|
||
| ```python |
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.
This custom Viewer component also shows some of the challenges it has.
- The component is not and cannot be used as a widget. I.e. you need to
pn.bindto andpn.dependsonchat_input.param.valuenotchat_input. There is no.from_parammethod etc. - It takes a lot of boiler plate code to separate the viewer
paramsfrom the_layoutparams. And gettingsizing_mode,width, ... properly linked up to the_layoutis almost impossible.
I.e. you can make custom components using Viewer. But I can't see how you can create something that Panel would be willing to include as a proper widget without really a lot of code.
| @@ -0,0 +1,145 @@ | |||
| # Create Chat Interfaces | |||
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.
| Below we will show you how to build a custom `Status` indicator. | ||
|
|
||
| ```python | ||
| import time |
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.
Should we add a Status component like this to Panel?
If yes, we should consider How we want to show this status if we have not yet started a run. Should it be disabled, not visible or have some custom look?
The current implementation accepts str steps only. That is probably not what we want if we add it to Panel. It should probably accept as a minimum Markdown and at best any Panel component.
The steps should probably not be constant.
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.
Maybe object and objects would be more in line with Panels naming convention than step and steps?
|
I will be on holiday for the next 3 days. I believe what is here is self contained and ready to include if you decide to release the Chat components within the next 3 days. I plan to add more examples like |
|
Superseded by #5670 |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |


Builds on top of #5633.
This PR adds a Streamlit Chat Migration Guide. It will
StreamlitConverterapp example some context about conversational chat apps. See Streamlit App Converter holoviz-topics/panel-chat-examples#61.Preview the guide here
FYI. @ahuang11
Questions
ChatEntrytoChatMessage. Both Streamlit and LangChain use the term message. For examplest.chat_message. TheChatEntryname could also mistakingly be interpreted as achat_inputlike component?ChatInputcomponent similar to Streamlitschat_input?Statuscomponent similar to Streamlitsstatus?Todo: