-2

I am working on a web bot app and I link it with luis.ai

I want to view the response of luis like which intent is been called and what was the entity called. I am using bot emulator version 4, but you can't find any type of info related to your intent or entities in it. Is there any way we can see the json response of luis.ai ? So that I can start building my bot further.

I am asking this because look How am I gonna know what's the format of luis response, how to get data from it as long as I don't know In which format i an receiving the response.

any details tutorial please?

David Fox
  • 10,603
  • 9
  • 50
  • 80
  • you can find samples here: https://github.com/Microsoft/BotBuilder-Samples. There are samples related to LUIS app – Thomas May 10 '18 at 10:10

1 Answers1

0

There two ways to see luis response.

  1. you can go to luis.ai and then copy the url of pulishment(in pulish section). And paste it in the navegator. You will get url like this: 'https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/xxxx?subscription-key=xxxxxxxxxx&verbose=true&timezoneOffset=0&q=your sentence', and setup q= your sentence.

  2. Another way, you can log all luis conversation in you code. If you use c sharp bot builder, you can use this luis class.

    [Serializable] public class LogedLuisService : ILuisService {

    private ILuisService service;
    private string moduleType;
    public LogedLuisService(ILuisService service)
    {
        this.service = service;
    }
    
    public Uri BuildUri(LuisRequest luisRequest)
    {
        return service.BuildUri(luisRequest);
    }
    
    public LuisRequest ModifyRequest(LuisRequest request)
    {
        return service.ModifyRequest(request);
    }
    
    public Task<LuisResult> QueryAsync(Uri uri, CancellationToken token)
    {
    
        return service
            .QueryAsync(uri, token)
            .ContinueWith(
                task => {
                    Trace.WriteLine("Luis: " + " : " + JsonConvert.SerializeObject(task.Result));
                    return task.Result;
                });
    
    }}
    
ahll
  • 2,329
  • 1
  • 19
  • 22
  • i am using Node JS – Azam Maqsood May 10 '18 at 12:52
  • I think that Node is more easy, because use message interceptor. https://learn.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-intercept-messages?view=azure-bot-service-3.0 – ahll May 10 '18 at 13:03
  • The voice should be sent to bot as Attachments, like image or video. If you use directline, use directline js https://github.com/Microsoft/BotFramework-DirectLineJS in client side. In backend side, I am not sure Luis could deal directly with voiz, you should use microsoft speech service to transform voiz to text before send to luis. – ahll May 10 '18 at 13:35
  • any idea how to use this tutorial in Node js ? https://learn.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-text-to-speech?view=azure-bot-service-3.0 – Azam Maqsood May 10 '18 at 14:00
  • check this? https://github.com/Microsoft/BotBuilder-Samples/blob/master/Node/demo-RollerSkill/app.js – ahll May 10 '18 at 14:11