This project integrates Python and AI to enable multiple AI agents to collaborate, achieving complex data processing tasks beyond the capability of a single AI. Key features include advanced web scraping, intelligent summarization, and enhanced Google search functionality, utilizing various APIs and models. This approach significantly improves data gathering and analysis, making it ideal for comprehensive research and complex problem-solving in various fields.
- Python 3.6 or higher installed on your system.
-
Create a Virtual Environment: This isolates your Python/Django setup on a per-project basis.
- Create a virtual environment using:
python -m venv venv
- Activate the virtual environment:
- For Linux or macOS:
source venv/bin/activate
- For Windows:
venv\Scripts\activate
- For Linux or macOS:
- Create a virtual environment using:
-
Install Dependencies:
- Install the required libraries. Run the command:
pip install requests beautifulsoup4 dotenv langchain autogen
- Install the required libraries. Run the command:
-
Environment Variables:
- Set up variable in a
.env
file in the script's directory:OPENAI_API_KEY=your_openai_api_key BROWSERLESS_API_KEY=your_browserless_api_key SERP_API_KEY=your_serper_api_key
- Set up variable in a
-
Configuration Files:
- Ensure the presence of a
OAI_CONFIG_LIST
JSON configuration file as required by the script.
- Ensure the presence of a
[{
"model": "gpt-4-1106-preview",
"api_key": your_openai_api_key
}]
After setting up your environment variables, an important next step is to set up a GPT assistant on OpenAI's platform. Here's a step-by-step guide to get you started:
- Sign Up or Log In:
- Visit OpenAI's platform.
- If you don't have an account, sign up. Otherwise, log in with your existing credentials.
-
Choose Your GPT Model:
- Decide which GPT model you want to use (e.g., GPT-3, GPT-3.5, etc.), the instruction and the function calling of each model.
-
Configure the GPT Assistant in Your Code:
- ensure you configure the GPT assistant to use the correct assistant ID.
-
Adding/Modifying Functions: Define or edit functions in the script, ensuring proper documentation.
-
Updating Environment and Configurations: Edit
.env
file and configuration files as needed. -
Integrating with Other APIs: Add necessary request code for additional API integrations.
-
Error Handling: Add robust error handling for increased resilience.
-
Activate Virtual Environment:
- Ensure that the virtual environment is activated before running the script.
-
Start the Bot:
- Use the following command to start the bot:
python bot/main.py
- Use the following command to start the bot:
- Handle API keys and configurations carefully to maintain script functionality.
- Test changes in a controlled environment before deployment.
This README provides comprehensive instructions for customization and usage of the script. Enjoy coding!