Create and return a Shiny app that wraps a [retro_agent()] in a browser-based UI for uploading Kaplan-Meier images, chatting with the model, and reviewing the reconstructed image, risk table, hazard ratios, and survival quantiles/probabilities.
Arguments
- chat
An `ellmer` chat object with no registered tools, as in [retro_agent()]. Cloned once per session.
- theme
A `bslib` theme object from `bslib::bs_theme()`, passed to `bslib::page_sidebar()`. The default is the Bootstrap 5 `"flatly"` preset with a dark navy primary color. The app puts a light/dark mode toggle (`bslib::input_dark_mode()`) in the top right of the main panel and starts in light mode. Bootstrap 5 color modes mean a single theme covers both modes.
- authentication_ui
`NULL`, or a Shiny tag/taglist to insert into the app's UI, outside the main navigation panels. Use this to layer on authentication UI (e.g. an SSO login gate) without `retroglyph` itself depending on any authentication package.
- authentication_server
`NULL`, or a function with arguments `input`, `output`, `session`, called first inside the app's server function. Use this together with `authentication_ui` to layer on server-side authentication logic.
- onStart
See `shiny::shinyApp()`.
- options
See `shiny::shinyApp()`.
Details
`chat` is cloned once per Shiny session (via `chat$clone(deep = TRUE)`), so the same `chat` object can be reused across multiple concurrent app sessions without one session's conversation or registered tools leaking into another's.
Examples
if (identical(Sys.getenv("RETROGLYPH_EXAMPLES"), "true")) {
retro_app(retro_chat_replay_simulation())
}
