1
votes

Is it possible to use LUIS API without MS BOT Framework? It is ok if I need to reference MS BOT Framework libraries for parsing LUIS response, but incoming request text will be from web application and not from MS BOT Framework. I am struggling to found recent proper nuget package, which will provide parsing capability and context management. So for example if bot asked for name and phone and user provided only name, bot will be able to ask for missing phone.

1

1 Answers

2
votes

If you want to use LUIS easily in C#, without using it inside Bot Framework, you can use Microsoft.Cognitive.LUIS package available on Nuget (see here)

This package contains the methods to query LUIS.

Sample:

private async Task QueryLuis(string querySentence)
{
    var client = new LuisClient("appId", "appKey", domain: "westeurope");
    var luisResult = await client.Predict("Text sent to LUIS for prediction");

    Console.WriteLine($"{luisResult.Intents.Select(i => $"Intent '{i.Name}' with score {i.Score}")}\r\n");
}

I guess in the future it may be included in a different package because as you can see in this psSdkJson6 branch of azure-sdk-for-net Github's project, there are also classes for LUIS Runtime available here