We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd6d40f commit 0c2e9ecCopy full SHA for 0c2e9ec
shiny/ui/_chat.py
@@ -502,9 +502,11 @@ def messages(
502
transform = transform_user == "all" or (
503
transform_user == "last" and i == len(messages) - 1
504
)
505
- key = "transform_key" if transform else "pre_transform_key"
506
- content_val = getattr(m, getattr(m, key))
507
- chat_msg = ChatMessageDict(content=str(content_val), role=m.role)
+ content_key = getattr(
+ m, "transform_key" if transform else "pre_transform_key"
+ )
508
+ content = getattr(m, content_key)
509
+ chat_msg = ChatMessageDict(content=str(content), role=m.role)
510
if not isinstance(format, MISSING_TYPE):
511
chat_msg = as_provider_message(chat_msg, format)
512
res.append(chat_msg)
0 commit comments