File size: 1,658 Bytes
b27b7d7
 
 
 
 
 
 
 
 
 
 
3f538a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: Epigen WhatsApp Webhook
emoji: 🧬
colorFrom: green
colorTo: blue
sdk: docker
sdk_version: 3.9
app_file: app.py
pinned: false
---

# Epigen WhatsApp Webhook

A webhook server for the Epigen WhatsApp integration. This service processes incoming WhatsApp messages using Google's Gemini AI model and responds with information about Epigen products and services.

## Features

- Processes incoming WhatsApp messages via Green API
- Generates AI responses using Google's Gemini model
- Maintains conversation history for personalized interactions
- Provides health check and monitoring endpoints

## Technical Stack

- **Flask**: Web framework for handling HTTP requests
- **Uvicorn**: ASGI server for running the Flask application
- **Google Generative AI**: AI model for generating responses
- **Green API**: WhatsApp integration provider

## Deployment

This application is designed to be deployed as a Docker container and is compatible with:
- Hugging Face Spaces
- AWS Elastic Beanstalk
- Google Cloud Run
- Any Docker-compatible cloud platform

## Local Development

1. Clone the repository
2. Create a `.env` file with the required API keys
3. Install dependencies: `pip install -r requirements.txt`
4. Run the application: `python app.py`

## Environment Variables

- `GREEN_API_ID`: Your Green API instance ID
- `GREEN_API_TOKEN`: Your Green API API token
- `GOOGLE_API_KEY`: Your Google API key for Gemini access
- `PORT`: The port to run the server on (default: 7860)

## API Endpoints

- `GET /`: Home page showing server status
- `GET /health`: Health check endpoint
- `GET/POST /webhook`: Main webhook endpoint for WhatsApp integration