Over a million developers have joined DZone.

Manage Chatbots From the Command Line

DZone's Guide to

Manage Chatbots From the Command Line

Learn about demonstrating the usage of the IBM Watson Conversation service's API functions with a nice command line tool.

· AI Zone ·
Free Resource

Did you know that 50- 80% of your enterprise business processes can be automated with AssistEdge?  Identify processes, deploy bots and scale effortlessly with AssistEdge.

I am a big fan of using the command line as most of you know by now. This applies to interacting with IBM Bluemix cloud and its services and for database systems like DB2 or dashDB. Thus, I was excited when the IBM Watson Conversation service added API functions to manage workspaces. To test the new API, I wrote a small Python-based tool to manage my Conversation workspaces. It both demonstrates the API usage as well as gives you a nice command line tool to list your workspaces, update them, save local copies or even create or delete workspaces. Read on and learn how to manage your Conversation workspaces.

Image title

Installation and Overview

If you have been working with the Watson service and Python before, you probably already have everything installed. If not, you need to install Python and then head over to the Watson Developer Tools and follow the link to the Python SDK. Install that, too. Now download a copy of or clone my repository watson-conversation-tool. As the last step, copy the file config.json.sample to config.json and fill in your credentials for the Watson Conversation service. Done.

The tool consists of a single script named wctool.py. It reads the parameters and options and defines a function for each of the commands (relating to the available workspace API). To list workspaces, to get details on existing workspace, update or delete it, or to create a new workspace, it simply passes the right parameters to the SDK functions for conversations.

Want to list all your workspaces? Use:

python wctool.py -l

 Get a specific workspace identified by its ID and save it to a file:

python wtool.py -g -id "henrik-22is22-cool-ce28a1d9f3f5" -o myWS.json

You find the full syntax and a sample work session with the tool in the README and in a notebook in the GitHub repository for my watson-conversation-tool.

If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or create an issue against the mentioned GitHub repository.

Consuming AI in byte sized applications is the best way to transform digitally. #BuiltOnAI, EdgeVerve’s business application, provides you with everything you need to plug & play AI into your enterprise.  Learn more.

chatbot ,bot development ,ai ,command line ,tutorial ,python

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}