Git Product home page Git Product logo

jfkfilesbot's Introduction

jfkfilesbot

A BOT built for the Dublin MTC using the Azure BOT framework that demonstrates cognitive services and accompanies the JFK Files demo

Setup

Create a LUIS Application

  1. Go to luis.ai and click "import new app" from your dashboard. Import the file 'JFK Files BOT.json'
  2. Click the Train button on the top right hand corner.
  3. Go to the publish tab and publish the app.
  4. From the publish screen copy the key string, this is the subscription_key needed later
  5. From the settings screen for the LUIS app copy the application ID for later

Prepare the BOT Application

  1. Download the reporsitory locally and open the Visual Studio solution file jfkfilesbot.sln.
  2. Create a new file called web.secret.config in the same folder as web.config
  3. Create a new file called IntentDialog.secrets.cs in the same folder as IntentDialog.cs
  4. Add the following code to web.secrets.config replacing the settings as described
<?xml version="1.0"?>
  <appSettings>
    <!-- update these with your Microsoft App Id and your Microsoft App Password from Azure bot settings-->
    <add key="AuthenticationConnectionName" value="[not used for this release]"/>
    <add key="BingSearchKey" value="[create a bing search resource in Azure and get the key from the keys section, make sure the pricing tier include web search]"/>
    <add key="MicrosoftAppId" value="[create a web bot in Azure and from settings select the App ID]"/>
    <add key="MicrosoftAppPassword" value="[in Azure settings for the BOT resource beside the App ID, from last setting, click the manage link and generate a new password]"/>
    <add key="AzureWebJobsStorage" value="[for the storage account in Azure created with the BOT enter the connection string from the access keys section]"/>
    <add key="AzureWebJobsDashboard" value="[same as above]"/>
	<add key="VisionAPIKey" value="[create a vision API service in Azure and grab the key]"/>
    <add key="VisionAPIRegion" value="[the region associated with your Vision service e.g. northeurope]"/>
  </appSettings>
  1. Open the file IntentDialog.secrets.cs and use the following code, replacing the IDs as appropriate
using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Internals.Fibers;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
using Microsoft.Bot.Connector;


namespace jfkfiles.bot
{
    /// <summary>
    /// The top-level natural language dialog for sample.
    /// </summary>
    [LuisModel("[replace with application ID recorded above]", "[replace with the subscription iID recorded above]")]
    internal sealed partial class IntentDialog : LuisDialog<object>
    {
      
    }
}
  1. Build and run the application in Visual Studio. Take not of the URL that launches, e.g. http://localhost:xxxx/

Test the BOT

  1. Download the BOT emulator
  2. Run the BOT emulator and create a new BOT configuration
  3. Enter a name and set the URL to http://localhost:xxxx/api/messages, using the correct port number from step 1
  4. Leave APP ID and Password blank

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.