Code Monkey home page Code Monkey logo

botandluis's Introduction

Alfonso's bot connected with LUIS

Notes for Alfonso

The LUIS app

Alfonso created a LUIS app very simple, with only two intents: "Greet" and "Help".

Just following these instructions: https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/luis-get-started-create-app

We learned concepts as intents, utterances and entities.

LUIS app Screenshot

Publish de app, and get the URL: https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/**app ID**?subscription-key=suscription key&verbose=true&timezoneOffset=0&q=

Bot

Open Visual Studio, and create a new "Bot project". New bot project

The template already create a functional bot (a little bit silly) that reply to the user's message with the same message and the number of characters in the user's message.

But... it's a start.

For connecting this bot with LUIS, Alfonso created a file in "Dialogs" folder: /SimpleSample/SimpleSample/Dialogs/HelpDialog.cs

There we defined an alternative dialog flow for the bot.

Remember add the line:

[LuisModel("<YOUR_LUIS_APP_ID>", "YOUR_SUBSCRIPTION_KEY", domain: "westus.api.cognitive.microsoft.com")]

over the class.

(replace the app id, for the one what was in the URL that you got when you published the LUIS app)

Then, the last thing Alfonso did is open this file: /SimpleSample/SimpleSample/Controllers/MessagesController.cs

and replace type of dialog it's created when the conversation starts. The line is:

await Conversation.SendAsync(activity, () => new Dialogs.HelpDialog());

Try the bot

F5. Get the URL. Paste it in the "Bot Framework Channel Emulator" and complete the URL with "/api/messages"

Talk to the bot.

Bot channel emulator

If you need more information about the integration of the bot with the LUIS app:

https://docs.microsoft.com/en-us/azure/cognitive-services/luis/home

And this tutorial: https://github.com/DanyStinson/BigBotTheory

botandluis's People

Contributors

isabelcabezasm avatar

Watchers

James Cloos avatar  avatar

botandluis's Issues

Added more intents and connected to my published LUIS app

When I use the Luis Bot URI, no issues, I get the correct response. I can't get SimpleSample to recognize any of the intents that I added to HelpDialogs.cs. For example
[LuisIntent("Birthdays")]
public async Task Birthdays(IDialogContext context, LuisResult result)
{
string message = $"Birthday Intent";
await context.PostAsync(message);
context.Wait(MessageReceived);
}
"Birthdays" is a valid intent that I can "see" through the URI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.