This project is a ReminderIA, allowing users to manage reminders via WhatsApp using AI (OpenAI) to interpret natural language commands. The application is built with Ruby on Rails and leverages services to maintain modular and clean code.
- WhatsApp Integration: Users can send text messages to create, edit, or delete reminders.
- AI for Natural Language Processing: Utilizes OpenAI to interpret user commands and create reminders.
- Reminder Management: Users can manage their reminders, including creating, editing, and deleting.
- Context Handling: The app maintains conversation context to provide more accurate responses.
-
Models
User
: Stores user information.Reminder
: Stores user reminders.Message
: Logs sent and received messages.Conversation
: Stores conversation context.
-
Services
OpenAIService
: Handles interaction with the OpenAI API.ReminderService
: Manages the creation of reminders based on OpenAI responses.
-
Controllers
RemindersController
: Handles CRUD actions for reminders.MessagesController
: Processes incoming WhatsApp messages and sends responses.
-
Clone this repository:
git clone https://github.com/noguerajulioces/whatsapp-with-OpenAI.git
-
Install dependencies:
bundle install
-
Set up the database:
rails db:create db:migrate
-
Configure your OpenAI and Twilio credentials in your
.env
file. -
Run the server:
rails s
- Set up your WhatsApp account to send messages to the app.
- Send messages with natural commands like "Remind me to buy milk tomorrow at 10 AM."
- The app will process the command, create a reminder, and respond with a confirmation.
Contributions are welcome. Please follow these steps:
- Fork the project.
- Create a new branch (
git checkout -b feature/new-feature
). - Make your changes and commit (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature/new-feature
). - Open a Pull Request.
This project is licensed under the MIT License.