Quick deployment of AWS API Gateway which receives SMS data from Twillio, then sends the text message as a question to OpenAI's default-chat sample, then creates a text message with the response from OpenAI and returns it to the user via SMS.
- Setup AWS CLI on your machine AWS Install Guide
- Install dependencies with NPM. Serverless will need the generated node modules to setup the lambda function
npm i
- Declare environment variables as below
ACCOUNT_SID=YOURTWILLIOSID
AUTH_TOKEN=YOURTWILLIOAUTHTOKEN
OPENAI_API_KEY=YOUROPENAIAPIKEY
PHONE=YOURTWILLIOPHONENUMBER
- Deploy with serverless
serverless deploy
To undo the changes to your aws
serverless remove
I'll eventually explain things better in this readme, but this is a brief explanation.