In this article, we will walk through the process of installing ChatDev on Mac systems with Apple Silicon (M1, M2, M3). We will also cover setting up the necessary Python environment using Conda. For detailed instructions on Conda installation, refer to this guide.
Step 1: Clone the ChatDev Repository
Start by cloning the ChatDev repository from GitHub:
git clone https://github.com/OpenBMB/ChatDev.git
cd ChatDev
Step 2: Set Up the Conda Environment
After Conda is installed (using the article linked above), create a Python 3.9 environment specifically for ChatDev. This step ensures compatibility with the dependencies:
conda create -n ChatDev_conda_env python=3.9 -y
conda activate ChatDev_conda_env
Step 3: Install Dependencies
Once the environment is activated, install the necessary dependencies for ChatDev by running:
cd ChatDev
pip install -r requirements.txt
Step 4: Set Up OpenAI API Key
ChatDev requires an OpenAI API key for generating code and other tasks. You’ll need to set this up as an environment variable:
export OPENAI_API_KEY="your_OpenAI_API_key"
Make sure to replace "your_OpenAI_API_key"
with your actual API key from OpenAI.
Step 5: Build Your Software
You can now generate software projects by running the following command, replacing the placeholders with your project idea and name:
python run.py --task "[description_of_your_idea]" --name "[project_name]"
For example:
python run.py --task "Build a simple weather app" --name "WeatherApp"
Step 6: Run Your Software
Once the project is created, navigate to the project folder:
cd WareHouse/project_name_DefaultOrganization_timestamp
Finally, run the main application:
python main.py
Conclusion
With ChatDev, you can quickly automate the development process using AI agents. Following these steps will get you up and running on your Mac with Apple Silicon. For any issues, ensure your dependencies and environment variables are correctly set up.
Feel free to refer to the linked Conda installation guide if needed!