Skip to content

Commit 005b556

Browse files
committed
Merge branch 'main' into chat-append-incremental
2 parents 70c6c99 + f0cc575 commit 005b556

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

shiny/ui/_chat.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,12 @@ def chat_ui(
10841084
else:
10851085
raise ValueError("Each message must be a string or a dictionary.")
10861086

1087-
message_tags.append(
1088-
Tag("shiny-chat-message", content=msg["content"], role=msg["role"])
1089-
)
1087+
if msg["role"] == "user":
1088+
tag_name = "shiny-user-message"
1089+
else:
1090+
tag_name = "shiny-chat-message"
1091+
1092+
message_tags.append(Tag(tag_name, content=msg["content"]))
10901093

10911094
res = Tag(
10921095
"shiny-chat-container",

0 commit comments

Comments
 (0)