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

ChatInterface callback_user and callback_avatar enhancements #5717

Closed
MarcSkovMadsen opened this issue Oct 22, 2023 · 7 comments · Fixed by #6958
Closed

ChatInterface callback_user and callback_avatar enhancements #5717

MarcSkovMadsen opened this issue Oct 22, 2023 · 7 comments · Fixed by #6958
Labels
good first issue Good for newcomers type: enhancement Minor feature or improvement to an existing feature
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Oct 22, 2023

I'm on the current main branch of Panel studying the dev documentation of the ChatInterface at https://holoviz-dev.github.io/panel/reference/chat/ChatInterface.html.

I see the following potential enhancements

  • The callback_user parameter is not mentioned in the Parameter section. It should be added.
    • It is in an example though.
  • There is no callback_avatar parameter. It should added.
@MarcSkovMadsen MarcSkovMadsen added the type: enhancement Minor feature or improvement to an existing feature label Oct 22, 2023
@MarcSkovMadsen MarcSkovMadsen added this to the Wishlist milestone Oct 22, 2023
@ahuang11
Copy link
Contributor

ahuang11 commented Oct 23, 2023

Regarding callback_user, it's referenced in ChatFeed, and to lessen redundancy, there's a mention about ChatFeed in ChatInterface:

Since ChatInterface inherits from ChatFeed, it features all the capabilities of ChatFeed; please see ChatFeed.ipynb for its backend capabilities.

About callback_avatar, I had that initially, but I believe you suggested it to be removed. If necessary, it can be added back, referring to this commit.

Another way to use avatar without returning ChatMessage / dict is instance.send(value, user=user, avatar=avatar), or in a streaming fashion instance.stream(**kwargs)

@ahuang11 ahuang11 added the good first issue Good for newcomers label Dec 4, 2023
@ahuang11
Copy link
Contributor

ahuang11 commented Dec 4, 2023

As I'm using this more, let's add callback_avatar too.

@shwetabh-23
Copy link

Hey, I went through the repo once to try and fix the issue, but it seems I'll need something more. Can you pinpoint what is to be done so I can contribute to this?
Thanks

  • shwetabh

@ahuang11
Copy link
Contributor

ahuang11 commented Apr 3, 2024

Thanks for your interest!

I believe you need to add callback_avatar, something similar to callback_user somewhere here.

https://github.com/holoviz/panel/blob/main/panel/chat/feed.py#L101-L102

Basically, reverting these changes from
a142060#diff-79a0463f14b802fa33f80516b9a6201485dc5a7af3271c249dee96886cf79a2cL656

@shwetabh-23
Copy link

I have create a PR, can you please review it and mention any more changes/corrections required?

@aksharasoman
Copy link

I'm confused.
Why was the 'callback_avatar' removed?
The docs of ChatInterface says it inherits ChatFeed. ChatFeed has "callback_avatar" parameter, while ChatInterface doesn't. I would like to specify custom 'callback_avatar'.

@ahuang11
Copy link
Contributor

It'll be available in panel 1.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants