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

Don't pop ChatInterface variables #6290

Merged
merged 5 commits into from
Feb 1, 2024
Merged

Don't pop ChatInterface variables #6290

merged 5 commits into from
Feb 1, 2024

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Jan 31, 2024

Without these changes, ChatInterface will not use the new username.

import panel as pn
pn.extension()

pn.chat.ChatInterface(callback=lambda _0, user, _2: user, user="NEW USERNAME")

image

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (811ccd1) 40.72% compared to head (ad3c846) 84.19%.
Report is 3 commits behind head on main.

Files Patch % Lines
panel/chat/interface.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6290       +/-   ##
===========================================
+ Coverage   40.72%   84.19%   +43.47%     
===========================================
  Files         301      301               
  Lines       45219    45247       +28     
===========================================
+ Hits        18414    38095    +19681     
+ Misses      26805     7152    -19653     
Flag Coverage Δ
ui-tests 40.71% <18.75%> (-0.01%) ⬇️
unitexamples-tests 71.84% <93.75%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hoxbro hoxbro marked this pull request as ready for review January 31, 2024 16:15
Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahuang11 please review.

Copy link
Contributor

@ahuang11 ahuang11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Co-authored-by: Andrew <15331990+ahuang11@users.noreply.github.com>
@hoxbro
Copy link
Member Author

hoxbro commented Jan 31, 2024

Looking at the failing test and a bit at the code. I think there are some possibilities:

  1. We promote the parameters user and avatar from Interface to Feed.
  2. Inherit send and stream (I think) in Interface and check if they are not set as a keyword argument, set them to the parameter if they haven't been set, and then call super.
  3. Update the if statement so we both have them as parameters and in the message kwargs.
  4. Maybe another way forward.

I think I like 2 the most.

@ahuang11
Copy link
Contributor

I like 2 too.

@hoxbro hoxbro merged commit 355a38b into main Feb 1, 2024
15 checks passed
@hoxbro hoxbro deleted the chatinterface_user branch February 1, 2024 08:00
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.

None yet

3 participants