An AI Bot who can understand natural language, execute your commands. Based on API.AI from Google.
- For Get request
GET https://api.api.ai/v1/query?v=20150910&query=weather&timezone=Europe/Paris&lang=en&contexts=weather&contexts=europe&latitude=37.459157&longitude=-122.17926&sessionId=1234567890
Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
- For Post request
POST https://api.api.ai/v1/query?v=20150910
Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json; charset=utf-8
POST body:
{
"query": [
"and for tomorrow"
],
"contexts": [{
"name": "weather",
"lifespan": 4
}],
"location": {
"latitude": 37.459157,
"longitude": -122.17926
},
"timezone": "America/New_York",
"lang": "en",
"sessionId": "1234567890"
}
- Send a request like
https://api.api.ai/v1/query?xxx
with token in headers. - Request will taken your natural language and go to API.AI server and find your agent based on your token.
- Your agent get user's raw request, it will recongnize user's background intent and transfer that into a json {'action': xxx, 'params': {} }
- Your agent will use its webhook api
https://wingjay-abot.herokuapp.com/webhook
, make a request to this webhook api, Just wingjay/abot repo. - My ABot will process request from API.AI, handle its action and params, generate a result, return to agent
- API.AI agent take this result and return to user.
Remember to use deploy
branch.
More info about Api.ai webhooks could be found here: Api.ai Webhook
Procfile tells Heroku how to run your application. Learn more: https://devcenter.heroku.com/articles/procfile