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

Allow image panes to be used for avatars #5870

Merged
merged 4 commits into from Nov 14, 2023

Conversation

ahuang11
Copy link
Contributor

import panel as pn
pn.extension()

chat = pn.chat.ChatInterface(avatar=pn.pane.Image("https://panel.holoviz.org/_static/logo_horizontal.png"))
chat

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (34df686) 83.99% compared to head (d1ad443) 83.99%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5870   +/-   ##
=======================================
  Coverage   83.99%   83.99%           
=======================================
  Files         290      290           
  Lines       42400    42411   +11     
=======================================
+ Hits        35612    35624   +12     
+ Misses       6788     6787    -1     
Flag Coverage Δ
ui-tests 40.88% <68.42%> (+<0.01%) ⬆️
unitexamples-tests 72.34% <100.00%> (+<0.01%) ⬆️

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.

@AlbertDeFusco
Copy link

Maybe this should be ImageBase like it is for Feed?

Avatar = Union[str, BytesIO, ImageBase]

@ahuang11
Copy link
Contributor Author

Thanks @AlbertDeFusco for reviewing. I just removed it since it's not used anywhere and param cannot accept typing types.

panel/chat/feed.py Outdated Show resolved Hide resolved
Copy link

@AlbertDeFusco AlbertDeFusco left a comment

Choose a reason for hiding this comment

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

This looks correct to me!

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.

Looks great, thanks for providing review @AlbertDeFusco !

@philippjfr philippjfr merged commit 7eb9c71 into main Nov 14, 2023
11 of 13 checks passed
@philippjfr philippjfr deleted the allow_passing_image_to_avatar branch November 14, 2023 17:54
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