This project is designed to assist sales representatives in efficiently managing their customer interactions via WhatsApp. The WhatsApp Bot automates responses, tracks customer queries, and streamlines communication, enabling sales teams to focus on closing deals and enhancing customer relationships. The bot's responses are based on data about the products being sold, which is provided by the seller.
- Automated responses: The bot can provide instant replies to common customer inquiries, ensuring prompt communication.
- Customer Query Tracking: All customer interactions are logged and tracked, making it easy to follow up on leads and maintain a history of conversations.
- Triggers: The bot can be configured with custom triggers to automate specific actions based on keywords or phrases in customer messages. These actions include sending a message to a Telegram channel for sellers with information about the encountered trigger and the customer (in progress).
- Product Data Integration: Bot responses are tailored based on the product data provided by the seller, ensuring accurate and relevant information is shared with customers (in progress).
- Bot Customization: The bot's behavior, greeting message, and triggers can be customized to meet the specific needs of different sales teams and products.
- Main page for customizing a chatbot. User can add queries, custom triggers and define greeting nessage.
- The Refresh Page allows the bot to resume interaction with a customer after encountering a trigger. When the bot detects a trigger in the conversation, it sends a default message and stops responding to the customer. By using the Refresh Page, sellers can re-enable the bot's functionality for that particular customer, ensuring continuous and effective communication.
Ensure you have access to the following resources before starting:
- Firebase: API key, authentication domain, and database URL.
- WhatsAppBot: Instance ID and API token for API interaction.
- Gemini: API key for Gemini model access.
- Vertex AI: Vertex AI project ID for integration.
- Google Cloud: Client ID, client secret, credentials, and other necessary parameters.
- Make sure you have the following installed:
- Node.js
- npm (Node Package Manager)
- Docker
- Clone the repository:
git clone https://github.com/Vlad1mirZhidkov/AI-Assistant.git- To install the required dependencies, run:
npm install
# or
yarn installLocate the existing .env file in the api directory of your project and update the following environment variables:
# Firebase
API_KEY="YOUR_FIREBASE_API_KEY"
AUTH_DOMAIN="YOUR_FIREBASE_AUTH_DOMAIN"
DATABASE_URL="YOUR_FIREBASE_DATABASE_URL"
PROJECT_ID="YOUR_FIREBASE_PROJECT_ID"
STORAGE_BUCKET="YOUR_FIREBASE_STORAGE_BUCKET"
MESSAGING_SENDER_ID="YOUR_FIREBASE_MESSAGING_SENDER_ID"
APP_ID="YOUR_FIREBASE_APP_ID"
MEASUREMENT_ID="YOUR_FIREBASE_MEASUREMENT_ID"
# WhatsAppBot
BOT_INSTANCE_ID="YOUR_WHATSAPPBOT_INSTANCE_ID"
BOT_API_TOKEN_INSTANCE="YOUR_WHATSAPPBOT_API_TOKEN_INSTANCE"
# Gemini
API_KEY_GEMINI="YOUR_GEMINI_API_KEY"
GEMINI_MODEL="gemini-pro"
# Vertex AI
VERTEX_AI_PROJECT_ID="YOUR_VERTEX_AI_PROJECT_ID"
# Google Cloud
GCLOUD_CLIENT_ID="YOUR_GCLOUD_CLIENT_ID"
GCLOUD_PROJECT_ID="YOUR_GCLOUD_PROJECT_ID"
GCLOUD_AUTH_URI="https://accounts.google.com/o/oauth2/auth"
GCLOUD_TOKEN_URI="https://oauth2.googleapis.com/token"
GCLOUD_AUTH_PROVIDER_CERT_URL="https://www.googleapis.com/oauth2/v1/certs"
GCLOUD_CLIENT_SECRET="YOUR_GCLOUD_CLIENT_SECRET"
REDIRECT_URIS=["http://localhost"]
GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/google-credit.json"
Replace YOUR_* with your actual API keys and IDs. If any variables are missing, add them to your .env file.
Firebase
- Go to the Firebase Console.
- Create a new project or select an existing project.
- Navigate to Project Settings and locate your Firebase configuration.
- Copy the necessary keys and add them to your .env file.
Gemini API
- Sign up for the Gemini API service.
- Generate your API key and model identifier.
- Add these values to your .env file under API_KEY_GEMINI and GEMINI_MODEL.
Google Cloud
- Go to the Google Cloud Console.
- Create a new project or select an existing project.
- Navigate to APIs & Services > Credentials.
- Create a new OAuth 2.0 Client ID and download the JSON file.
- Add the values from the JSON file to your .env file under the respective fields.
Bot Configuration
-
Create a WhatsApp Bot:
- Log in to your GreenAPI account.
- Navigate to the section for creating new projects or bots.
- Create a new project and select the WhatsApp bot option.
-
Obtain BOT_INSTANCE_ID and BOT_API_TOKEN_INSTANCE:
- After creating the project, you will be provided with a unique instance ID and API token.
- You can find these details in the settings section of your project or on the dashboard.
- Start the development server:
npm start- Build for production:
npm run build- Run with Docker:
docker-compose up --buildThe admin panel is accessible at: http://localhost:3000
The current version of the product is accessable only locally from Docker. This is the instruction to use it on you machine:
- Admin Panel:
docker pull vladimirzhidkov/rfghj:inno-whatsapp-interns-admin-paneldocker run -d -p 3000:3000 vladimirzhidkov/rfghj:inno-whatsapp-interns-admin-panel- API Design:
docker pull vladimirzhidkov/rfghj:inno-whatsapp-interns-api
docker run -d -p 4000:4000 vladimirzhidkov/rfghj:inno-whatsapp-interns-apiThe admin panel is accessible at: http://localhost:3000

