0

当我从 LUIS Web 应用程序触发查询时,我收到了这个 json 响应:

```
{
  "query": "I am piyush ",
  "topScoringIntent": {
    "intent": "askDetails",
    "score": 0.9953322,
    "actions": [
      {
        "triggered": false,
        "name": "askDetails",
        "parameters": [
          {
            "name": "firstName",
            "type": "User Name::First Name",
            "required": true,
            "value": [
              {
                "entity": "piyush",
                "type": "User Name::First Name",
                "resolution": {}
              }
            ]
          },
          {
            "name": "lastName",
            "type": "User Name::Last Name",
            "required": true,
            "value": null
          }
        ]
      }
    ]
  },
  "intents": [
    {
      "intent": "askDetails",
      "score": 0.9953322,
      "actions": [
        {
          "triggered": false,
          "name": "askDetails",
          "parameters": [
            {
              "name": "firstName",
              "type": "User Name::First Name",
              "required": true,
              "value": [
                {
                  "entity": "piyush",
                  "type": "User Name::First Name",
                  "resolution": {}
                }
              ]
            },
            {
              "name": "lastName",
              "type": "User Name::Last Name",
              "required": true,
              "value": null
            }
          ]
        }
      ]
    },
    {
      "intent": "None",
      "score": 0.0756940544
    }
  ],
  "entities": [
    {
      "entity": "piyush",
      "type": "User Name::First Name",
      "startIndex": 5,
      "endIndex": 10,
      "score": 0.9813254,
      "resolution": {}
    }
  ],
  "dialog": {
    "prompt": "Please enter your Last Name",
    "parameterName": "lastName",
    "parameterType": "User Name::Last Name",
    "contextId": "52a81547-9896-4d80-ad58-85606b51cb89",
    "status": "Question"
  }
}
```

当我从节点 js 代码运行相同的 url 时,我没有得到与上图相同的响应:

```
var builder = require("botbuilder");
var recognizer = new builder.LuisRecognizer(LuisModelUrl);
var intents = new builder.IntentDialog({ recognizers: [recognizer] });
intents.matches('askDetails', [
        function(session, args, next) {
            console.log('dialog', args.dialog);
       }
]);

```

args.dialog 在这里未定义,它在 args 变量中没有给我相同的 json。

4

1 回答 1

0

我认为您不需要使用 args.dialog。查看Luis 示例以了解代码应如何包含在Node.js.

如果您要打印 Luis 回复,请尝试使用args.Entities.

于 2016-12-17T12:00:56.400 回答