-
-
Notifications
You must be signed in to change notification settings - Fork 527
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 Streamlit Chat Migration Guide #5642
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.bind
to andpn.depends
onchat_input.param.value
notchat_input
. There is no.from_param
method etc. - It takes a lot of boiler plate code to separate the viewer
params
from the_layout
params
. And gettingsizing_mode
,width
, ... properly linked up to the_layout
is 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 |
Builds on top of #5633.
This PR adds a Streamlit Chat Migration Guide. It will
StreamlitConverter
app example some context about conversational chat apps. See Streamlit App Converter holoviz-topics/panel-chat-examples#61.Preview the guide here
FYI. @ahuang11
Questions
ChatEntry
toChatMessage
. Both Streamlit and LangChain use the term message. For examplest.chat_message
. TheChatEntry
name could also mistakingly be interpreted as achat_input
like component?ChatInput
component similar to Streamlitschat_input
?Status
component similar to Streamlitsstatus
?Todo: