MetaGPT爆火出圈!2美元就能当老板,GitHub狂揽11.2k星,AI智能体「多面手」诞生
新智元报道
新智元报道
【新智元导读】AI智能体有多火,看看MetaGPT就知道了。一个能够让你2美元当老板的项目,GitHub已经狂揽11.2k星。
MetaGPT
网友实现
python startup.py "write p5.js code for Flappy Bird where you control a yellow bird continuously flying between a series of green pipes. The bird flaps every time you left click the mouse. If the bird falls to the ground or hits a pipe, you lose. This game goes on infinitely until you lose and you get points the further you go" --code_review True
安装
# 步骤1:确保已经安装了NPM。并使用npm安装mermaid-js
npm --version
sudo npm install -g @mermaid-js/mermaid-cli
# 步骤2:确保已经安装了Python 3.9+。可以使用以下命令进行检查:
python --version
# 步骤3:克隆仓库到本机,并进行安装。
git clone https://github.com/geekan/metagpt
cd metagpt
python setup.py install
# 步骤1: 下载metagpt官方镜像并准备好config.yaml
docker pull metagpt/metagpt:v0.3
mkdir -p /opt/metagpt/{config,workspace}
docker run --rm metagpt/metagpt:v0.3 cat /app/metagpt/config/config.yaml > /opt/metagpt/config/config.yaml
vim /opt/metagpt/config/config.yaml # 修改config
# 步骤2: 使用容器运行metagpt演示
docker run --rm \
--privileged \
-v /opt/metagpt/config:/app/metagpt/config \
-v /opt/metagpt/workspace:/app/metagpt/workspace \
metagpt/metagpt:v0.3 \
python startup.py "Write a cli snake game"
# 也可以启动一个容器并在其中执行命令
docker run --name metagpt -d \
--privileged \
-v /opt/metagpt/config:/app/metagpt/config \
-v /opt/metagpt/workspace:/app/metagpt/workspace \
metagpt/metagpt:v0.3
docker exec -it metagpt /bin/bash
python startup.py "Write a cli snake game"
以特权模式运行,有权限运行浏览器
将主机目录/opt/metagpt/config映射到容器目录/app/metagpt/config
将主机目录/opt/metagpt/workspace映射到容器目录/app/metagpt/workspace
# 也可以自己构建metagpt镜像
git clone https://github.com/geekan/MetaGPT.git
cd MetaGPT && docker build -t metagpt:custom .
# 复制配置文件并进行必要的修改
cp config/config.yaml config/key.yaml
演示:启动一个创业公司
python startup.py "Write a cli snake game"
# 使用code review模式会增加开销,但同时也会提升代码质量和成功率
python startup.py "Write a cli snake game" --code_review True
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.
# 我们是一家AI软件创业公司。通过投资我们,您将赋能一个充满无限可能的未来。
POSITIONAL ARGUMENTS
IDEA
Type: str
你的创新想法,例如"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.
# 作为投资者,您有机会向这家AI公司投入一定的美元金额。
--n_round=N_ROUND
Type: int
Default: 5
NOTES
也可以用FLAGS的语法,来处理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)
参考资料:
https://arxiv.org/pdf/2308.00352.pdf
https://github.com/geekan/MetaGPT
https://twitter.com/99aico/status/1684249002437668864
微信扫码关注该文公众号作者
戳这里提交新闻线索和高质量文章给我们。
来源: qq
点击查看作者最近其他文章