| chatbot_server | R Documentation |
Sets up the chat server for a single module.
Creates its own Chat object, binds tools from
the MCP session registry, and manages per-module conversation
history.
The function renders chatbot_ui() into the drawer's
uiOutput via shiny::renderUI, and opens the drawer
when a "button.click" shidashi-event with
type = "open_drawer" is received.
Any element with data-shidashi-action="shidashi-button"
data-shidashi-type="open_drawer" can trigger the drawer.
This function is injected into each module's server function by
modules.R when agents.yaml has enabled: yes.
It is called inside shiny::moduleServer(), so session
is module-scoped. shinychat operations use the scoped
session; only drawer and event operations use
session$rootScope().
chatbot_server(
input,
output,
session,
id = "shidashi-chatbot",
drawer_id = "shidashi_drawer",
agent_conf = NULL
)
input, output, session |
Standard Shiny server arguments
(typically module-scoped when inside |
id |
character; must match the |
drawer_id |
character; the output ID of the drawer's
|
agent_conf |
list; parsed |
Called for side effects (sets up observers). Returns
invisible(NULL).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.