This is a Twitter bot that summarises Tweet threads into a single Tweet using OpenAI's GPT-based models. The bot Twitter account is @GPTSummary. The bot is hosted on AWS using AWS Lambda functions to receive and process webhooks.
Install the AWS SAM CLI. Once installed, you can build the Python bot:
sam build --config-env python
Once built, you can deploy to AWS:
sam deploy
This will create an AWS Cloudformation stack for the bot. It will then create an API Gateway HTTP API, Lambda function, and needed IAM roles.
The code obtains API keys from the AWS Systems Manager Parameter
Store
at runtime. You should create parameters with the prefix /gpt-bot/
(e.g. /gpt-bot/CONSUMER_KEY
).