GithubHelp home page GithubHelp logo

apiku's Introduction

Instructions:

Open the config.py file and to configure it, you will add your keys and add the other information as requested - follow the example below:


ParametersTypeRequired
timeoutIntegerYes
debugTrue or FalseYes
sourceStringOptional
keyString and IntegerYes
langStringYes
typeIAIntegerYes
------------

Then create an account at https://api.ai/ and follow the steps below

Deploy to Heroku

  • Step 3

The Heroku site will open and you will be asked to fill in the name of the application. Enter the name of the application (choose any name) and click the 'Deploy for Free' button.

  • Step 4

Create an API.AI agent and enable webhook:

  • Click on Fulfillment in the left side menu

  • Turn Webhook on

  • Insert the link https://[App Name].herokuapp.com/webhook into the URL field

  • Click ‘Save’.


Print-exemplo01


For your own service, you may want to secure it with basic auth and/or headers (if you don’t want other people using your web hooks).

  • Step 5

Create a return intent that matches your artificial intelligence requests. The action should be set to ApiSimsimi, make sure the 'Enable webhook for this intent' option in the 'Fulfillment' section is checked. And the 'Text response' field, define the response that will be displayed in case of web service errors, do the same for the other function, but define the action of each as defined in the 'app.py' file

  • Step 6

Now you can test simsimi artificial intelligence requests on the test console API.AI

In the returned JSON, the “fulfillment” object will look like this:

{
  "id": "2j3nb2obh3ob2o3bo2-b3olkn2lk3n2",
  "timestamp": "2017-01-05T22:52:17.269Z",
  "result": {
    "source": "agent",
    "resolvedQuery": "simsimi",
    "action": "ApiSimsimi",
    "actionIncomplete": false,
    "parameters": {
      "any": "simsimi"
    },
    "contexts": [],
    "metadata": {
      "intentId": "j2bn3oj-kb2j3blj2bn3ljb2ljk3bjkl",
      "webhookUsed": "true",
      "webhookForSlotFillingUsed": "true",
      "intentName": "IA"
    },
    "fulfillment": {
      "speech": "oi vagabundo\n\n",
      "source": "SimSimi",
      "messages": [
        {
          "type": 0,
          "speech": "oi vagabundo?\n\n"
        }
      ]
    },
    "score": 1
  },
  "status": {
    "code": 200,
    "errorType": "success"
  },
  "sessionId": "21hkj12bh3kjb1k3bb23bk-jb2jk3b"
}

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.