Skip to content

Commit

Permalink
Follow up to #1736: correct markup generation for user role messages (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert authored Oct 15, 2024
1 parent d0354b9 commit f0cc575
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions shiny/ui/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,12 @@ def chat_ui(
else:
raise ValueError("Each message must be a string or a dictionary.")

message_tags.append(
Tag("shiny-chat-message", content=msg["content"], role=msg["role"])
)
if msg["role"] == "user":
tag_name = "shiny-user-message"
else:
tag_name = "shiny-chat-message"

message_tags.append(Tag(tag_name, content=msg["content"]))

res = Tag(
"shiny-chat-container",
Expand Down

0 comments on commit f0cc575

Please sign in to comment.