同步操作将从 Gitee 极速下载/MetaGPT 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Assign different roles to GPTs to form a collaborative software entity for complex tasks.
Code = SOP(Team)
is the core philosophy. We materialize SOP and apply it to teams composed of LLMs.Software Company Multi-Role Schematic (Gradually Implementing)
For example, if you type python startup.py "Design a RecSys like Toutiao"
, you would get many outputs, one of them is data & api design
It requires around $0.2 (GPT-4 api's costs) to generate one example with analysis and design, around $2.0 to a full project.
# Step 1: Ensure that NPM is installed on your system. Then install mermaid-js.
npm --version
sudo npm install -g @mermaid-js/mermaid-cli
# Step 2: Ensure that Python 3.9+ is installed on your system. You can check this by using:
python --version
# Step 3: Clone the repository to your local machine, and install it.
git clone https://github.com/geekan/metagpt
cd metagpt
python setup.py install
Note:
If already have Chrome, Chromium, or MS Edge installed, you can skip downloading Chromium by setting the environment variable
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
to true
.
Some people are having issues installing this tool globally. Installing it locally is an alternative solution,
npm install @mermaid-js/mermaid-cli
don't forget to the configuration for mmdc in config.yml
PUPPETEER_CONFIG: "./config/puppeteer-config.json"
MMDC: "./node_modules/.bin/mmdc"
# Step 1: Download metagpt official image and prepare config.yaml
docker pull metagpt/metagpt:v0.3.1
mkdir -p /opt/metagpt/{config,workspace}
docker run --rm metagpt/metagpt:v0.3.1 cat /app/metagpt/config/config.yaml > /opt/metagpt/config/key.yaml
vim /opt/metagpt/config/key.yaml # Change the config
# Step 2: Run metagpt demo with container
docker run --rm \
--privileged \
-v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \
-v /opt/metagpt/workspace:/app/metagpt/workspace \
metagpt/metagpt:v0.3.1 \
python startup.py "Write a cli snake game"
# You can also start a container and execute commands in it
docker run --name metagpt -d \
--privileged \
-v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \
-v /opt/metagpt/workspace:/app/metagpt/workspace \
metagpt/metagpt:v0.3.1
docker exec -it metagpt /bin/bash
$ python startup.py "Write a cli snake game"
The command docker run ...
do the following things:
/opt/metagpt/config
to container directory /app/metagpt/config
/opt/metagpt/workspace
to container directory /app/metagpt/workspace
python startup.py "Write a cli snake game"
# You can also build metagpt image by yourself.
git clone https://github.com/geekan/MetaGPT.git
cd MetaGPT && docker build -t metagpt:custom .
OPENAI_API_KEY
in any of config/key.yaml / config/config.yaml / env
config/key.yaml > config/config.yaml > env
# Copy the configuration file and make the necessary modifications.
cp config/config.yaml config/key.yaml
Variable Name | config/key.yaml | env |
---|---|---|
OPENAI_API_KEY # Replace with your own key | OPENAI_API_KEY: "sk-..." | export OPENAI_API_KEY="sk-..." |
OPENAI_API_BASE # Optional | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |
python startup.py "Write a cli snake game"
# Use code review will cost more money, but will opt for better code quality.
python startup.py "Write a cli snake game" --code_review True
After running the script, you can find your new project in the workspace/
directory.
You can tell which platform or tool you want to use when stating your requirements.
python startup.py "Write a cli snake game based on pygame"
NAME
startup.py - We are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities.
SYNOPSIS
startup.py IDEA <flags>
DESCRIPTION
We are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities.
POSITIONAL ARGUMENTS
IDEA
Type: str
Your innovative idea, such as "Creating a snake game."
FLAGS
--investment=INVESTMENT
Type: float
Default: 3.0
As an investor, you have the opportunity to contribute a certain dollar amount to this AI company.
--n_round=N_ROUND
Type: int
Default: 5
NOTES
You can also use flags syntax for POSITIONAL ARGUMENTS
from metagpt.software_company import SoftwareCompany
from metagpt.roles import ProjectManager, ProductManager, Architect, Engineer
async def startup(idea: str, investment: float = 3.0, n_round: int = 5):
"""Run a startup. Be a boss."""
company = SoftwareCompany()
company.hire([ProductManager(), Architect(), ProjectManager(), Engineer()])
company.invest(investment)
company.start_project(idea)
await company.run(n_round=n_round)
You can check examples
for more details on single role (with knowledge base) and LLM only examples.
If you have any questions or feedback about this project, please feel free to contact us. We highly appreciate your suggestions!
We will respond to all questions within 2-3 business days.
https://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。