1. Task Description:
Develop a system for automated communication with clients through Instagram, Gmail, and WhatsApp using the ChatGPT model. All received leads must be automatically entered into Google Sheets.
#### 2. System Requirements:
##### 2.1 Integration with Platforms:
- *Instagram*:
- Set up Instagram Graph API to receive messages from Instagram Direct.
- Organize sending responses through the API.
- *Gmail*:
- Set up Gmail API to receive emails from a specific mailbox.
- Implement a function to send responses to incoming emails.
- *WhatsApp*:
- Connect WhatsApp Business API for sending and receiving messages.
##### 2.2 Using ChatGPT:
- Connect OpenAI API to receive responses from ChatGPT based on incoming messages.
- Set up request parameterization for more accurate responses (including input context, requirements, and constraints).
##### 2.3 Data Storage:
- Integrate Google Sheets API to save lead information in Google Sheets.
- Structure the table considering the necessary data (e.g., client name, contact details, request text, communication channel, and time).
#### 3. Business Logic:
- Set up message routing: each channel (Instagram, Gmail, WhatsApp) should direct messages to the system, which will process them using ChatGPT.
- Determine which types of messages require manual processing and direct such messages to an operator.
- Create logic for automatically creating a record in Google Sheets for each new message.
#### 4. Administrative Interface:
- Develop a simple interface for configuring and monitoring integrations (could be a web application or console interface).
- Ability to view system logs and message processing.
#### 5. Security Requirements:
- Ensure secure storage and use of API keys.
- Implement basic protection against spam and unwanted messages.