The following shows how to invoke the tool. The help section is automagically generated and needs some rework. Thus, see below for some real usage or read the README in the GitHub repository.
In [3]:
%%sh
python wctool.py -h
The first command lists the existing workspaces. Before you can use the tool you need to put your credentials for Watson Conversation into the file config.json. A template is provided as config.json.sample.
In [5]:
%%sh
python wctool.py -l
Get the details for one of the existing workspaces. There is not much extra information compared to the LIST command.
In [6]:
%%sh
python wctool.py -g -id "93fac4d7-2fab-4a02-b282-ce28a1d9f3f5"
However, when using the option "-full", then the entire workspace is returned.
In [7]:
%%sh
python wctool.py -g -id "93fac4d7-2fab-4a02-b282-ce28a1d9f3f5" -full
Instead of printing the workspace to the screen, it can be saved to a file. When the "-o" (output) option is used it is assumed that you are interested in the full workspace.
In [8]:
%%sh
python wctool.py -g -id "93fac4d7-2fab-4a02-b282-ce28a1d9f3f5" -o henriksWorkspace.json
An existing workspace can be used to populate a new workspace. So here is how to create one:
In [9]:
%%sh
python wctool.py -c -name HenriksNewWorkspace -desc "Test for my blog" -lang de -i henriksWorkspace.json
An existing workspace can be updated and the name, its language or the description be changed. It is also possible to replace intents, entities and other parts of the workspace (shown in the step hereafter).
In [10]:
%%sh
python wctool.py -u -id "f5db2447-55dd-4c7e-a764-2319a17dbfee" -name "Henrik renamed it"
Now you would edit the local file to make changes to intents, entities or dialog node and store the changes back to the file henriksWorkspace.json. That file is taken as input for the UPDATE command. Only those section specified as options are updated. In the sample below only intents and counterexamples are updated.
In [11]:
%%sh
python wctool.py -u -id "f5db2447-55dd-4c7e-a764-2319a17dbfee" -intents -counterexamples -i henriksWorkspace.json
A workspace can also be deleted. Use with care...
In [12]:
%%sh
python wctool.py -d -id "f5db2447-55dd-4c7e-a764-2319a17dbfee"
Use the logs option to obtain dialog logs. Using the -filter
option you can pass a filter string (see README.md).
In [3]:
%%sh
python wctool.py -logs -id "09969794-a510-4eab-95f3-b482d94a7ac6" -filter "request.input.text:Hello"
A powerful option is -dialog
. It allows to testdrive a dialog:
In [5]:
%%sh
python wctool.py -dialog -id "09969794-a510-4eab-95f3-b482d94a7ac6"
The above shows the beginning of a dialog. It is interactive and can be aborted (stopped) by either using Ctrl+C or typing "bye" as a input message.
In [ ]: