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

defined callback_user in lines 104 and 382 #6662

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

shwetabh-23
Copy link

I added the line :
callback_avatar = param.ClassSelector(class_=(str, BinaryIO), doc="""
The default avatar to use for the entry provided by the callback.
Takes precedence over ChatEntry.default_avatars if set; else, if None,
defaults to the avatar set in ChatEntry.default_avatars if matching key exists.
Otherwise defaults to the first character of the callback_user.""")
and changed line :
avatar = None

to :
avatar = self.callback_avatar

@philippjfr philippjfr requested a review from ahuang11 April 4, 2024 10:15
@ahuang11
Copy link
Contributor

ahuang11 commented Apr 4, 2024

Thanks for creating this!

Could you please run
pre-commit install

Also, can you add a few tests like a142060#diff-5408514bec6f5895a04fa7826621bcce676dd161c74eff71bce900e6c677a584L595-L600

@shwetabh-23
Copy link
Author

I ran the "pre-commit install" as suggested and added a line (384):

user = self.callback_user
avatar = self.callback_avatar

    assert avatar == "👨"

let me know if this is correct or if some modifications are to be made

@ahuang11
Copy link
Contributor

ahuang11 commented Apr 8, 2024

No, the assert should be under panel/tests/widgets/test_chat.py

@shwetabh-23
Copy link
Author

I cannot find both files at the mentioned directories. Please confirm from your end. in the main directory (https://github.com/holoviz/panel/tree/main), I get to panel/tests/widgets and there is no test_chat.py file and no chat.py file at panel/widgets. what is going wrong?

@ahuang11
Copy link
Contributor

ahuang11 commented Apr 8, 2024

Woops, we moved them to panel/tests/chat/

@shwetabh-23
Copy link
Author

okay, can you verify if this is correct? I've added an assertion in the test_feed.py file under the function test_default_avatars_superseded_by_callback_avatar.

@ahuang11
Copy link
Contributor

ahuang11 commented Apr 8, 2024

I'd explicitly set callback_avatar to something else prior to ensure it's actually working as intended.

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

2 participants