TextGenie is an application that allows users to send text messages that interact with OpenAI GPT (Generative Pre-trained Transformer) and receive a response back. It integrates with Twilio for sending and receiving SMS messages and utilizes the OpenAI GPT API for generating AI-powered responses.
TextGenie incorporates rate limiting using Redis, which is seamlessly integrated into the application. Redis provides a robust and efficient solution for managing and enforcing rate limits, ensuring the stability and reliability of the system.
Before running the application, make sure you have the following:
- Docker: Install Docker on your machine from https://www.docker.com/.
- Clone the repository:
git clone https://github.com/ajaybirratoul/text-genie.git
- Create a new file named
.env
in the project root directory and add the following environment variables:
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number
OPEN_AI_TOKEN=your_openai_token
Replace your_twilio_account_sid
, your_twilio_auth_token
, your_twilio_phone_number
, and your_openai_token
with your respective values.
- Build and start the Docker containers:
docker-compose up
-
The application will start and be accessible at http://localhost:8080.
-
Expose the application to the internet (e.g., using ngrok) to receive incoming SMS messages.
-
Send an SMS message to the phone number associated with the application.
-
The application will receive the message and send it to the OpenAI GPT API for processing.
-
OpenAI GPT will generate a response based on the message content.
-
The application will send the generated response back to the sender's phone number.
This project is licensed under the MIT License.