Description Usage Arguments Details Examples
chatbot Shiny server Module
1 |
input |
input variable to read the value from |
output |
output variable to read the value from |
session |
session variable to read the value from |
api_key |
api key to connect to your watson assistant |
workspace |
your watson assistant workspace |
rv.chat |
optional variable to pass your chatbot as a reactive variable |
A shiny server module for the chatbot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | if(interactive()){
## app.R ##
library(shiny)
library(shinydashboard)
library(IMWatson)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(IMWatson::chatbotUI("watson"))
)
server <- function(input, output, session) {
callModule(IMWatson::chatbot, "watson", api_key = your_api_key,
workspace = your_workspace)
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.