Class: ConversationV1

ConversationV1

new ConversationV1(options)

Parameters:
Name Type Description
options Object
Properties
Name Type Description
version_date Object
Source:

Members

(static) VERSION_DATE_2016_07_11 :string

Initial release

Type:
  • string
Source:

(static) VERSION_DATE_2016_09_20 :string

9/20 update made changes to response format

  • context.system.dialog_stack changed from an array of strings to an array of objects

Old:

 "context": {
    "system": {
      "dialog_stack": [
        "root"
      ],

New:

 "context": {
    "system": {
      "dialog_stack": [
        {
          "dialog_node": "root"
        }
      ],
Type:
  • string
Source:
See:

(static) VERSION_DATE_2017_02_03 :string

02/03 Update

  • Absolute scoring has now been enabled.
Type:
  • string
Source:
See:
  • https://www.ibm.com/watson/developercloud/doc/conversation/irrelevant_utterance.html

    Old:

     "intents": [
       { "intent" : "turn_off", "confidence" : 0.54 },
       { "intent" : "locate_amenity", "confidence" : 0.4},
       { "intent" : "weather", "confidence" : 0.06}
     ]

    Previously all intent confidence values summed to 1.0. New:

     "intents": [
       { "intent" : "turn_off", "confidence" : 0.54 },
       { "intent" : "locate_amenity", "confidence" : 0.52},
       { "intent" : "weather", "confidence" : 0.01}
     ]

    Now each intent is scored individually with a maximum confidence value of 1.

    • Irrelevant input detection. Previously an intent was always returned regardless of whether the system considered it irrelevant to the training data within the workspace. With Irrelevant input detection the system will now return an empty intent array if the system thinks the input is irrelevant to the workspace content. Old:
      "input" : { "text" : "what color is the sky?"},
      "intents": [
      { "intent" : "weather", "confidence" : 0.36 },
      { "intent" : "turn_off", "confidence" : 0.33},
      { "intent" : "locate_amenity", "confidence" : 0.31}
      ]
      New:
      "input" : { "text" : "what color is the sky?"},
      "intents": []
  • https://www.ibm.com/watson/developercloud/doc/conversation/release-notes.html#3-february-2017

(static) VERSION_DATE_2017_04_21 :string

Adds support entities (with values and synonyms) and accessing logs

Type:
  • string
Source:
See:

Methods

createCounterExample(params, callbackopt)

Method: createCounterExample

Add a new counterexample to a workspace. Counterexamples are examples that have been marked as irrelevant input.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
text String

The text of a user input example.

callback function <optional>
Source:

createEntity(params, callbackopt)

Method: createEntity

Create a new entity

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
entity String <optional>
description String <optional>
metadata Object <optional>
values Array.<Object> <optional>
callback function <optional>
Source:

createExample(params, callbackopt)

Method: createExample

Add a new user input example to an intent.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
intent String
text String
callback function <optional>
Source:

createIntent(params, callbackopt)

Method: createIntent

Create a new intent

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
intent String <optional>
description String <optional>
examples Array.<Object> <optional>
callback function <optional>
Source:

createSynonym(params, callbackopt)

Method: createSynonyms

Add a new synonym to an entity value.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
entity String <optional>
value String <optional>
synonym String <optional>
callback function <optional>
Source:

createValue(params, callbackopt)

Method: createValue

Add a new value to an entity.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
entity String <optional>
value String <optional>
metadata Object <optional>
synonyms Array.<String> <optional>
callback function <optional>
Source:

createWorkspace(params, callbackopt)

Method: createWorkspace

Creates a new workspace

Model Schema

 {
  "name": "string",
  "description": "string",
  "language": "string",
  "metadata": {},
  "counterexamples": [
    {
      "text": "string"
    }
  ],
  "dialog_nodes": [
    {
      "dialog_node": "string",
      "description": "string",
      "conditions": "string",
      "parent": "string",
      "previous_sibling": "string",
      "output": {
        "text": "string"
      },
      "context": {},
      "metadata": {},
      "go_to": {
        "dialog_node": "string",
        "selector": "string",
        "return": true
      }
    }
  ],
  "entities": [
    {
      "entity": "string",
      "description": {
        "long": [
          "string"
        ],
        "short": [
          "string"
        ],
        "examples": [
          "string"
        ]
      },
      "type": "string",
      "source": "string",
      "open_list": false,
      "values": [
        {
          "value": "string",
          "metadata": {},
          "synonyms": [
            "string"
          ]
        }
      ]
    }
  ],
  "intents": [
    {
      "intent": "string",
      "description": "string",
      "examples": [
        {
          "text": "string"
        }
      ]
    }
  ]
 }

Example Response

 {
  "name": "Pizza app",
  "created": "2015-12-06T23:53:59.153Z",
  "language": "en",
  "metadata": {},
  "updated": "2015-12-06T23:53:59.153Z",
  "description": "Pizza app",
  "workspace_id": "pizza_app-e0f3"
 }
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
name String <optional>
description String <optional>
language String <optional>
metadata Object <optional>
entities Array.<Object> <optional>
intents Array.<Object> <optional>
dialog_nodes Array.<Object> <optional>
counterexamples Array.<Object> <optional>
callback function <optional>
Source:

deleteCounterExample(params, callbackopt)

Method: deleteCounterExample

Delete a counterexample from a workspace. Counterexamples are examples that have been marked as irrelevant input.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
text String

The text of a user input example.

callback function <optional>
Source:

deleteEntity(params, callbackopt)

Method: deleteEntity

Delete an entity from a workspace.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
entity String
callback function <optional>
Source:

deleteExample(params, callbackopt)

Method: deleteExample

Delete a user input example from an intent.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
intent String
text String
callback function <optional>
Source:

deleteIntent(params, callbackopt)

Method: deleteIntent

Delete an intent from a workspace

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
intent String
callback function <optional>
Source:

deleteSynonym(params, callbackopt)

Method: deleteSynonym

Delete a synonym from an entity value.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
entity String
value String
synonym String
callback function <optional>
Source:

deleteValue(params, callbackopt)

Method: deleteValue

Delete an entity from a workspace.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
entity String
value String
callback function <optional>
Source:

deleteWorkspace(params, callbackopt)

Method: deleteWorkspace

Deletes the specified workspace

Parameters:
Name Type Attributes Description
params Object

{ workspace_id: '' }

Properties
Name Type Description
workspace_id
callback function <optional>
Source:

getCounterExample(params, callbackopt)

Method: getCounterExample

Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
text String

The text of a user input example.

callback function <optional>
Source:

getCounterExamples(params, callbackopt)

Method: getCounterExamples

List the counterexamples for a workspace. Counterexamples are examples that have been marked as irrelevant input

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
page_limit Number <optional>
include_count Boolean <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

getEntities(params, callbackopt)

Method: getEntities

List the entities for a workspace.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

page_limit Number <optional>
include_count Boolean <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

getEntity(params, callbackopt)

Method: getEntity

Get information about an entity, optionally including all entity content.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
entity String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

callback function <optional>
Source:

getExample(params, callbackopt)

Method: getExample

Get information about a user input example.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
intent String
text String
callback function <optional>
Source:

getExamples(params, callbackopt)

Method: getExamples

List the user input examples for an intent.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
intent String
page_limit Number <optional>
include_count Boolean <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

getIntent(params, callbackopt)

Method: getIntent

Get information about an intent, optionally including all intent content.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
intent String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

callback function <optional>
Source:

getIntents(params, callbackopt)

Method: getIntents

List the intents for a workspace.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

page_limit Number <optional>
include_count Boolean <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

getLogs(params, callbackopt)

Method: getLogs

Returns information about requests (user input) received, and responses sent, by the workspace.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
filter String
page_limit Number <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

getSynonym(params, callbackopt)

Method: getSynonym

Get information about an entity value.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
entity String
value String
synonym String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

callback function <optional>
Source:

getSynonyms(params, callbackopt)

Method: getSynonyms

List the synonyms for an entity value.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
entity String
value String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

page_limit Number <optional>
include_count Boolean <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

getValue(params, callbackopt)

Method: getValue

Get information about an entity value.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
entity String
value String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

callback function <optional>
Source:

getValues(params, callbackopt)

Method: getValues

List the values for an entity.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
entity String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

page_limit Number <optional>
include_count Boolean <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

getWorkspace(params, callbackopt)

Method: getWorkspace

Returns information about a specified workspace or return the whole workspace

Example Response (with default export value):

 {
  "name": "Pizza app",
  "created": "2015-12-06T23:53:59.153Z",
  "language": "en",
  "metadata": {},
  "updated": "2015-12-06T23:53:59.153Z",
  "description": "Pizza app",
  "workspace_id": "pizza_app-e0f3"
 }
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
workspace_id String
export Boolean <optional>
false

if true, the full contents of all of the sub-resources are returned

callback function <optional>
Source:

listWorkspaces(paramsopt, callbackopt)

Method: listWorkspaces

Returns the list of workspaces in Watson Conversation Service instance

Example Response:

 {
   "workspaces": [
     {
       "name": "Pizza app",
       "created": "2015-12-06T23:53:59.153Z",
       "language": "en",
       "metadata": {},
       "updated": "2015-12-06T23:53:59.153Z",
       "description": "Pizza app",
       "workspace_id": "pizza_app-e0f3"
     }
   ]
 }
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
page_limit Number <optional>
include_count Boolean <optional>
sort String <optional>
cursor String <optional>
callback function <optional>
Source:

message(params)

Method: message

Returns a response to a user utterance.

Example response for 2017-02-03 version_date:

 {
   "intents": [
     {
       "intent": "turn_on",
       "confidence": 0.999103316650195
     }
   ],
   "entities": [
     {
       "entity": "appliance",
       "location": [
         12,
         18
       ],
       "value": "light"
     }
   ],
   "input": {
     "text": "Turn on the lights"
   },
   "output": {
     "log_messages": [],
     "text": [
       "Hi. It looks like a nice drive today. What would you like me to do?"
     ],
     "nodes_visited": [
       "node_1_1467221909631"
     ]
   },
   "context": {
     "conversation_id": "820334ac-ee79-45b5-aa03-7958dcd0fd34",
     "system": {
       "dialog_stack": [
         {
           "dialog_node": "root"
         }
       ],
       "dialog_turn_counter": 1,
       "dialog_request_counter": 1
     }
   }
 }
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
workspace_id
input <optional>
context <optional>
alternate_intents <optional>
false

includes other lower-confidence intents in the intents array.

output <optional>
entities <optional>
intents <optional>
Source:

updateCounterExample(params, callbackopt)

Method: updateCounterExample

Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
old_text String
text String

The text of a user input example.

callback function <optional>
Source:

updateEntity(params, callbackopt)

Method: updateEntity

Update an existing entity with new or modified data. You must provide JSON data defining the content of the updated entity.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
old_entity String
entity String
description String
metadata Object
values Array.<Object>
callback function <optional>
Source:

updateExample(params, callbackopt)

Method: updateExample

Update the text of a user input example.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
intent String
text String
example Object
callback function <optional>
Source:

updateIntent(params, callbackopt)

Method: updateIntent

Update an existing intent with new or modified data. You must provide JSON data defining the content of the updated intent.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
old_intent String
intent String
description String
examples Array.<Object>
callback function <optional>
Source:

updateSynonym(params, callbackopt)

Method: updateSynonym

Update an existing entity value synonym with new text.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
entity String
value String
old_synonym String
synonym String
callback function <optional>
Source:

updateValue(params, callbackopt)

Method: updateValue

Update an existing entity value with new or modified data. You must provide JSON data defining the content of the updated entity value.

Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id String
entity String
old_value String
value String
metadata Object
synonyms Array.<String>
callback function <optional>
Source:

updateWorkspace(params, callbackopt)

Method: updateWorkspace

Updates a workspace

Example value

 {
  "name": "Pizza app",
  "created": "2015-12-06T23:53:59.153Z",
  "language": "en",
  "metadata": {},
  "description": "Pizza app",
  "workspace_id": "pizza_app-e0f3",
  "counterexamples": [
    {
      "text": "string"
    }
  ],
  "dialog_nodes": [
    {
      "dialog_node": "string",
      "description": "string",
      "conditions": "string",
      "parent": "string",
      "previous_sibling": "string",
      "output": {
        "text": "string"
      },
      "context": {},
      "metadata": {},
      "go_to": {
        "dialog_node": "string",
        "selector": "string",
        "return": true
      }
    }
  ],
  "entities": [
    {
      "entity": "string",
      "description": {
        "long": [
          "string"
        ],
        "short": [
          "string"
        ],
        "examples": [
          "string"
        ]
      },
      "type": "string",
      "source": "string",
      "open_list": false,
      "values": [
        {
          "value": "string",
          "metadata": {},
          "synonyms": [
            "string"
          ]
        }
      ]
    }
  ],
  "intents": [
    {
      "intent": "string",
      "description": "string",
      "examples": [
        {
          "text": "string"
        }
      ]
    }
  ]
 }

Example Response:

 {
  "name": "Pizza app",
  "created": "2015-12-06T23:53:59.153Z",
  "language": "en",
  "metadata": {},
  "updated": "2015-12-06T23:53:59.153Z",
  "description": "Pizza app",
  "workspace_id": "pizza_app-e0f3"
 }
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
workspace_id String
name String <optional>
description String <optional>
language String <optional>
metadata Object <optional>
entities Array.<Object> <optional>
intents Array.<Object> <optional>
dialog_nodes Array.<Object> <optional>
counterexamples Array.<Object> <optional>
callback function <optional>
Source:

workspaceStatus(params, callbackopt)

Method: workspaceStatus

Returns the training status of the specified workspace

Example Response:

 {
  "workspace_id": "pizza_app-e0f3",
  "training": "true"
 }
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Description
workspace_id
callback function <optional>
Source: