chat_ui_history

chat_ui_history(id, **attrs)

Create a conversation-history view bound to a chat.

Use this helper for a custom placement of chat history. A :func:~shinychat.page_chat sidebar can include the same view more directly with chat_sidebar(history=True).

Parameters

Name Type Description Default
id str ID of the target chat. The ID is resolved in the current Shiny module namespace. required
**attrs TagAttrValue Additional HTML attributes for the history element. The for attribute is owned by this helper and cannot be overridden. {}

Returns

Name Type Description
Tag A <shiny-chat-history> element connected to id.

Examples

from shiny import ui
from shinychat import chat_ui, chat_ui_history

ui.div(
    chat_ui("chat", show_history=False),
    chat_ui_history("chat", class_="conversation-list"),
)

See Also

: Include history in a page sidebar. : Create the target chat UI.