This is POC for a conversational bot made with api.ai as a conversational engine. It is hosted in AWS lambda and the bot is integrated with Telgram and Facebook.
The file BankSearch.zip can by imported in api.ai as an agent to handle the conversation and the actions.
The bot gives you directions (with maps in telegram) for near bank offices of the bank of your choice.
The code in the repo is just a POC (not well structured, no tests...) and is just intented to demonstrate the integration for api.ai and lambda functions to handle the anctions performed by the api.ai agent.
- Create an account in api.ai and upload the BankSearch.zip as a new agent
- Create a lambda function (full in the next step)
- Create an API Gateway in AWS that invokes the lambda function
- Configure api.ai agent with a webhook pointing to the API Gateway endpoint you've just created
- Enable integrations with telegram and facebook in api.ai for your agent
- Install and configure AWS cli (optional, this is for automatic deploy your code to lambda. Make sure your cli has permissions to upload new function code to lambda)
- Generate a google maps api key
- Clone this repo and
npm install
- Change config.tpl to config.js and edit values with googleMapsApiKey and telegramBotToken
- Upload your code to the lambda function (either manually or with the release.sh if you have configured the AWS cli (eg. ./release.sh MY_LAMBDA_FUNCTION_NAME)
- Start chatting