You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromshinyimportApp, uifromtypingimportAny# Create a custom message type that won't be recognized by any normalizerclassCustomMessage:
def__init__(self, content):
self.content=contentapp_ui=ui.page_fillable(
ui.panel_title("Custom Normalizer Example"),
ui.chat_ui("chat"),
fillable_mobile=True,
)
defserver(input, output, session):
chat=ui.Chat(id="chat")
@chat.on_user_submitasyncdef_():
# This will trigger the error with incorrect guidancecustom_msg=CustomMessage("Hello")
awaitchat.append_message(custom_msg) # Will raise error with incorrect guidanceapp=App(app_ui, server)
Behavior
Current: When a user tries to use a message type that doesn't have a registered normalizer, the error message suggests registering a custom normalizer via shiny.ui._chat_types.registry.register(), which doesn't exist.
Expected: The error message should direct users to the correct path: shiny.ui._chat_normalize.message_normalizer_registry.register().
Error Messages (if any)
ValueError: Could not find a normalizer for message of type<class '__main__.CustomMessage'>: <__main__.CustomMessage object at 0x7f8c1d3e5f90>.
Consider registering a custom normalizer via shiny.ui._chat_types.registry.register()
Environment
MacOS
The text was updated successfully, but these errors were encountered:
Component
UI (ui.*)
Severity
P2 - Medium (workaround exists)
Shiny Version
1.3.1
Python Version
3.11
Minimal Reproducible Example
Behavior
Current: When a user tries to use a message type that doesn't have a registered normalizer, the error message suggests registering a custom normalizer via
shiny.ui._chat_types.registry.register()
, which doesn't exist.Expected: The error message should direct users to the correct path:
shiny.ui._chat_normalize.message_normalizer_registry.register()
.Error Messages (if any)
Environment
The text was updated successfully, but these errors were encountered: