Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation: how to get the response object #123

Closed
durera opened this issue Dec 1, 2016 · 1 comment
Closed

Conversation: how to get the response object #123

durera opened this issue Dec 1, 2016 · 1 comment

Comments

@durera
Copy link

durera commented Dec 1, 2016

I had a quick play and set up a very basic dialog tree to allow something like show defect|issue|task 4567

Testing in the "Try it out section" I can see Watson generate the expected response for various inputs, and I have set the response (using advanced settings) to:

{
  "output": {
    "text": "Showing @resource @sys-number",
    "action": "show",
    "resource": "@resource",
    "id": "@sys-number"
  }
}

When I send the request via the Python library (0.22.0, installed from pip) I get this response:

{
  "intents": [
    {
      "confidence": 1,
      "intent": "show"
    }
  ],
  "entities": [
    {
      "location": [
        5,
        9
      ],
      "value": "workitem",
      "entity": "resource"
    },
    {
      "metadata": {
        "numeric_value": 78809
      },
      "location": [
        10,
        15
      ],
      "value": "78809",
      "entity": "sys-number"
    }
  ],
  "context": {
    "conversation_id": "e8c551d1-2e7a-4dda-abe7-e4ae94335520",
    "system": {
      "dialog_turn_counter": 1,
      "dialog_stack": [
        {
          "dialog_node": "node_1_1480605220956"
        }
      ],
      "dialog_request_counter": 1
    }
  },
  "input": {
    "text": "show task 78809"
  },
  "output": {
    "log_messages": [],
    "nodes_visited": [
      "node_1_1480605220956"
    ],
    "text": []
  },
  "alternate_intents": false
}

I can see that the API has successfully parsed the input, but I was hoping to get the custom response object that I defined in the dialog returned, otherwise the application would have to duplicate the logic already in the dialog to work out what entity contains the id (for example).

Also, I don't even get back the basic text defined in the response output.

Is there someway to get that response object back, or am I limited to only working with the raw entities & intents? There is an output element in the object returned, but it lacks any of my content.

@jsstylos
Copy link
Contributor

jsstylos commented Dec 1, 2016

Hi David, this is an issue with the service and dialog definition, not the Python SDK. Without looking at your dialog nodes it's hard to debug specifically, but either the node with the output is not being hit or the output format in the node definition is not correct. This issue can also be debugged directly in the try-it-out panel inside the web tool, without the SDK. http://stackoverflow.com/questions/tagged/watson-conversation is probably the best place for non-SDK related questions.

@jsstylos jsstylos closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants