Learn R Programming

IMWatson (version 0.5.0)

chatbot: chatbot Shiny server Module

Description

chatbot Shiny server Module

Usage

chatbot(input, output, session, api_key, workspace, rv.chat = FALSE)

Arguments

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

Details

A shiny server module for the chatbot

Examples

Run this code
# NOT RUN {
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)
 }
# }

Run the code above in your browser using DataLab