Skip to content

Commit

Permalink
Handle if value is ChatMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jan 31, 2024
1 parent 94ac159 commit ad3c846
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion panel/chat/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,12 @@ def send(
-------
The message that was created.
"""
return super().send(value, user=user or self.user, avatar=avatar or self.avatar, respond=respond)
if not isinstance(value, ChatMessage):
if user is None:
user = self.user
if avatar is None:
avatar = self.avatar
return super().send(value, user=user, avatar=avatar, respond=respond)

def stream(
self,
Expand Down

0 comments on commit ad3c846

Please sign in to comment.