Interact seamlessly with OpenAI through WhatsApp, enabling prompt-based conversations with AI models.
WhaBot AI Companion is a serverless solution designed to integrate OpenAI API (v4) with WhatsApp messaging. This project enables users to send queries through WhatsApp, processes them via OpenAI's API, and responds with the AI-generated output—all without manual intervention. The solution is hosted on AWS Lambda with API Gateway, leveraging Node.js modules packaged into a layer for efficient and scalable execution.
- WhatsApp Integration: Receive user queries via WhatsApp messaging.
- OpenAI API Integration: Utilize OpenAI API (v4) for natural language processing and generate AI-powered responses.
- Serverless Architecture: Hosted on AWS Lambda with API Gateway for seamless and scalable operations.
- Node.js Modules as Layers: Dependencies are packaged into layers for easier management and deployment.
- Infrastructure as Code (IaC): Utilizes Serverless YAML for defining and managing the infrastructure.
To set up and deploy the WhaBot AI Companion, follow these steps:
- Prerequisites: Ensure you have an AWS account set up with appropriate permissions and access to the OpenAI API.
- Configuration:
- Update the necessary configurations such as API keys, WhatsApp number, and any specific settings in the designated configuration files.
- Deployment:
- Use Serverless YAML to define the AWS infrastructure and deploy the solution.
- Testing:
- Send messages to the configured WhatsApp number and observe the responses generated by the AI.
WhaBot-AI-Companion/
│
├── src/
│ ├── lambdaFunction.js # Main Lambda function handling WhatsApp requests and OpenAI integration
│ ├── openaiService.js # Service for interacting with OpenAI API
│ └── ... # Other relevant files
│
├── serverless.yml # Serverless framework configuration for AWS Lambda and API Gateway
├── package.json # Node.js dependencies and scripts
├── .env.example # Example environment variables configuration
└── README.md # Project documentation
Contributions to WhaBot AI Companion are welcome! If you have suggestions, feature ideas, or want to report issues, please feel free to create an issue or submit a pull request.
This project is licensed under the MIT License.