| .gitignore | ||
| constants.py | ||
| main.py | ||
| README.md | ||
| requirements.txt | ||
Tender Notification System
This Python script automatically fetches tenders from a specified API, evaluates their content using OpenAI's GPT-4 model, and sends email notifications for those deemed interesting by the AI.
Features
- Fetch Tenders: Retrieves tender data from a remote API.
- AI Evaluation: Uses OpenAI's GPT-4 model to analyze and evaluate the content of each tender.
- Email Notifications: Sends email notifications for tenders that are considered interesting based on AI evaluation.
Requirements
To run this script, you will need:
- Python 3.x or higher
openaiPython libraryrequestsPython library- Access to an SMTP server for sending emails
Installation
- Clone this repository or download the script to your local machine.
- Install the required Python libraries using pip:
pip install openai requests
- Set up your environment variables or modify the
constants.pyfile to include:- Your OpenAI API key
- SMTP server details (host, username, password)
- Email addresses for sending and receiving notifications
Configuration
Before running the script, ensure that the constants.py file is configured with the correct values:
API_KEY: Your OpenAI API key.SMTP_HOST,SMTP_USERNAME,SMTP_PASSWORD: SMTP server details for sending emails.SMTP_FROM,SMTP_TO_LIST: Email addresses for the sender and recipients.SMTP_TO_LISTshould be a list of email addresses to which notifications will be sent.
Usage
To execute the script, navigate to the directory containing the script and run:
python main.py
Logging
The script logs all its operations, including any errors encountered during execution, in a log.txt file located in the same directory as the script. This helps in monitoring its performance and troubleshooting issues.
Error Handling
In case of errors, the script logs the error details and sends an email notification to a specified email address with the error information.