1

I'm doing a simple chatbot with watson. I have a python script. Assume script is this for simplicity:

x=5
x

And in watson i want to return :

result is 5

However, I'm not sure, how to interact with python. My research showed that it is something related to NodeJS and JSON, but I couldn't find any example or tutorial that suites my requirements.

Could someone route me what course of actions should i take or any documentation?

data_henrik
  • 16,724
  • 2
  • 28
  • 49
rakamakafo
  • 1,144
  • 5
  • 21
  • 44
  • If you want to interact with Watson Conversation / Watson Assistant from Python, check out this tool. You can use it for a dialog and for retrieving / uploading workspaces: https://github.com/data-henrik/watson-conversation-tool/ – data_henrik Apr 29 '18 at 19:56

1 Answers1

2

The data between Watson Assistant and a client, an application, is exchanged as JSON-formatted data. The service itself has a REST API and you can use it from any programming language or with command-line tools. For Python, there is even a SDK.

There are some samples written in Python. I recommend my own code :). There is a tool I wrote to interact with Watson Assistant / Watson Conversation (blog entry is here). Another Python sample is what I called EgoBot (blog is here). It shows how you can even change the dialog itself from within the chatbot. Basically, you can tell the bot to learn stuff. The examples should get you started.

data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • Thanks, @data_henrik . I tried first tutorial, that didn't work . Than I tried efobot tutorial. I set up all service credentials. That returning errors due to no parathesis in script, i fixed that. And then when I run python egobot.py -setup -name egoEnglish -lang en I receive error no module named 'watson-developer-cloud' What that may mean? – rakamakafo Apr 29 '18 at 20:56
  • Did you install the SDK that I linked? `pip install watson-developer-cloud`. – data_henrik Apr 30 '18 at 05:21
  • Double check the version of Python being used, as well as any other packages (like json, pandas, etc.) that might need to get installed into your environment. – Daniel Toczala Apr 30 '18 at 13:19