3
votes

I have created ~100 intents on Conversation service on Bluemix by importing them from a csv. That's fine. Now, I need to create dialogs for them. I can do that from the administrative dashboard of the service, but that's a tedious task. I could easily automate the task if I could define them in a Json and upload it via a REST API or via the service dashboard (like for the intents). I don't see the capability, so the question is: Is there an API that I can use to upload a dialogs definition? Thanks.

2

2 Answers

3
votes

You can upload a json workspace via the service dashboard (there's an upload icon next to the Create button on the Workspaces page) so you should be able to define dialogs directly in the workspace json.

There's currently no way to automatically upload a workspace via the API- there's only one method, to send input, as shown in the API docs.

0
votes

I have been using the Conversation Service from more than an year and what I've seen so far there isn't a way to only upload Dialog into the Conversation Service workspace without importing the whole workspace. But you can import a new workspace into the Conversation service if you have downloaded any old workspace. This file will be in a .json format and it will have all intents, entities and Dialog entries.

Now coming back to your question, unlike Intent and Entity, creating the Dialog via .CSV or .JSON file is not that straightforward. Here is the Conversation Start node of a workspace in json format.

{
    "go_to": null,
    "title": "Conversation Start",
    "output": {
        "text": {
            "values": ["Hello $username! How can I help you today?"],
            "selection_policy": "sequential"
        }
    },
    "parent": null,
    "context": null,
    "created": "2017-06-19T05:39:17.433Z",
    "updated": "2017-06-19T05:40:51.102Z",
    "metadata": null,
    "conditions": "conversation_start",
    "description": null,
    "dialog_node": "Conversation Start",
    "previous_sibling": null
}

$username is a context parameter

As you can see it's not that easy to form it properly. One small mistake while mentioning a dialog_node or previous_sibling and the flow will be changed. I think this is probably why they have not given a import option for Dialog. Let's hope that IBM make this process a bit simpler in future.