Learn R Programming

IMWatson (version 0.5.0)

init: Initialize connection with Watson's Conversation API

Description

Connect to Watson's Conversation API

Usage

init(api_key, workspace, url, version)

Arguments

api_key

API Key

workspace

Workspace api

url

optional argument that defaults to "https://gateway.watsonplatform.net/assistant/api/v1/workspaces"

version

optional argument that defaults to "2018-09-20"

Value

The function returns a lits with the text and the contex that is returned by your assistant.

Details

This function allows you to start a connection to your Watson Assistant

Examples

Run this code
# NOT RUN {
if(interactive()){
# See https://cloud.ibm.com/apidocs/assistant
 conection <- init(api_key, workspace)
 conection[["text"]]
 chat1 <- chat("Ignacio", conection, username, password, workspace)
 chat1[["text"]]
 chat2 <- chat("I would like flower suggestions", chat1, username, password, workspace)
 chat2[["text"]]
 }
# }

Run the code above in your browser using DataLab