前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >MetaGPT( The Multi-Agent Framework):颠覆AI开发的革命性多智能体元编程框架

MetaGPT( The Multi-Agent Framework):颠覆AI开发的革命性多智能体元编程框架

原创
作者头像
汀丶人工智能
发布2023-10-13 16:49:03
7300
发布2023-10-13 16:49:03
举报
文章被收录于专栏:NLP/KGNLP/KG

"MetaGPT( The Multi-Agent Framework):颠覆AI开发的革命性多智能体元编程框架"

一个多智能体元编程框架,给定一行需求,它可以返回产品文档、架构设计、任务列表和代码。这个项目提供了一种创新的方式来管理和执行项目,将需求转化为具体的文档和任务列表,使项目管理变得高效而智能。对于需要进行规划和协调的项目,这个框架提供了强大的支持.

MetaGPT's 能力展示

https://github.com/geekan/MetaGPT/assets/34952977/34345016-5d13-489d-b9f9-b82ace413419

例如,如果你输入' python startup.py ' ' Design a RecSys like今日头条' ',你会得到很多输出,其中之一是data & api Design

生成一个分析和设计示例的成本约为0.2美元(在GPT-4 API费用中),而生成一个完整项目的成本约为2.0美元。

1.安装

1.1 安装视频指南

代码语言:shell
复制
#Step 1: Ensure that NPM is installed on your system. Then install mermaid-js. (If you don't have npm in your computer, please go to the Node.js offical website to install Node.js https://nodejs.org/ and then you will have npm tool in your computer.)
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
pip install -e.

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,
代码语言:shell
复制

npm install @mermaid-js/mermaid-cli

代码语言:txt
复制
  • don't forget to the configuration for mmdc in config.yml
代码语言:yaml
复制

PUPPETEER_CONFIG: "./config/puppeteer-config.json"

MMDC: "./node_modules/.bin/mmdc"

代码语言:txt
复制
  • if pip install -e. fails with error [Errno 13] Permission denied: '/usr/local/lib/python3.11/dist-packages/test-easy-install-13129.write-test', try instead running pip install -e. --user
  • 将Mermaid图表转换为SVG、PNG和PDF格式。除了Node.js版本的mermaid - cli之外,你现在还可以选择使用Python版本的剧作家、pyppeteer或mermaid。
  • Playwright
    • Install Playwright
代码语言:txt
复制
```bash
代码语言:txt
复制
pip install playwright
代码语言:txt
复制
```
代码语言:txt
复制
- **Install the Required Browsers**
代码语言:txt
复制
to support PDF conversion, please install Chrominum.
代码语言:txt
复制
```bash
代码语言:txt
复制
playwright install --with-deps chromium
代码语言:txt
复制
```
代码语言:txt
复制
- **modify `config.yaml`**
代码语言:txt
复制
uncomment MERMAID_ENGINE from config.yaml and change it to `playwright`
代码语言:txt
复制
```yaml
代码语言:txt
复制
MERMAID_ENGINE: playwright
代码语言:txt
复制
```
  • pyppeteer
    • Install pyppeteer
代码语言:txt
复制
```bash
代码语言:txt
复制
pip install pyppeteer
代码语言:txt
复制
```
代码语言:txt
复制
- **Use your own Browsers**
代码语言:txt
复制
pyppeteer alow you use installed browsers,  please set the following envirment
代码语言:txt
复制
```bash
代码语言:txt
复制
export PUPPETEER_EXECUTABLE_PATH = /path/to/your/chromium or edge or chrome
代码语言:txt
复制
```
代码语言:txt
复制
please do not use this command to install browser, it is too old
代码语言:txt
复制
```bash
代码语言:txt
复制
pyppeteer-install
代码语言:txt
复制
```
代码语言:txt
复制
- **modify `config.yaml`**
代码语言:txt
复制
uncomment MERMAID_ENGINE from config.yaml and change it to `pyppeteer`
代码语言:txt
复制
```yaml
代码语言:txt
复制
MERMAID_ENGINE: pyppeteer
代码语言:txt
复制
```
  • mermaid.ink
    • modify config.yaml
代码语言:txt
复制
uncomment MERMAID_ENGINE from config.yaml and change it to `ink`
代码语言:txt
复制
```yaml
代码语言:txt
复制
MERMAID_ENGINE: ink
代码语言:txt
复制
```  
代码语言:txt
复制
Note: this method does not support pdf export.

1.2 Docker安装指南

代码语言:shell
复制
#Step 1: Download metagpt official image and prepare config.yaml
docker pull metagpt/metagpt:latest
mkdir -p /opt/metagpt/{config,workspace}
docker run --rm metagpt/metagpt:latest 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:latest \
    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:latest

docker exec -it metagpt /bin/bash
$ python startup.py "Write a cli snake game"

The command docker run ... do the following things:

  • Run in privileged mode to have permission to run the browser
  • Map host directory /opt/metagpt/config to container directory /app/metagpt/config
  • Map host directory /opt/metagpt/workspace to container directory /app/metagpt/workspace
  • Execute the demo command python startup.py "Write a cli snake game"

1.3 构造自定义

代码语言:shell
复制
#You can also build metagpt image by yourself.
git clone https://github.com/geekan/MetaGPT.git
cd MetaGPT && docker build -t metagpt:custom .

1.4 相关配置

  • Configure your OPENAI_API_KEY in any of config/key.yaml / config/config.yaml / env
  • Priority order: config/key.yaml > config/config.yaml > env
代码语言:shell
复制
#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"

2.相关教程

代码语言:shell
复制
#Run the script
python startup.py "Write a cli snake game"
#Do not hire an engineer to implement the project
python startup.py "Write a cli snake game" --implement False
#Hire an engineer and perform code reviews
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.

  • Preference of Platform or Tool

You can tell which platform or tool you want to use when stating your requirements.

代码语言:shell
复制
python startup.py "Write a cli snake game based on pygame"
  • 使用指南
代码语言:txt
复制
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

2.1 快速开始

It is difficult to install and configure the local environment for some users. The following tutorials will allow you to quickly experience the charm of MetaGPT.

Try it on Huggingface Space

https://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d

3.更多推荐:终端LLM AI模型:mlc-llm

大型语言模型的机器学习编译(MLC LLM)是一种高性能的通用部署解决方案,允许使用带有编译器加速的本机api来本地部署任何大型语言模型。这个项目的使命是让每个人都能使用ML编译技术在每个人的设备上开发、优化和部署人工智能模型。

项目链接:https://github.com/mlc-ai/mlc-llm

更多优质内容请关注公号:汀丶人工智能;会提供一些相关的资源和优质文章,免费获取阅读。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • "MetaGPT( The Multi-Agent Framework):颠覆AI开发的革命性多智能体元编程框架"
    • MetaGPT's 能力展示
    • 1.安装
      • 1.1 安装视频指南
        • 1.2 Docker安装指南
          • 1.3 构造自定义
            • 1.4 相关配置
            • 2.相关教程
              • 2.1 快速开始
              • 3.更多推荐:终端LLM AI模型:mlc-llm
              相关产品与服务
              容器服务
              腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
              领券
              问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档