写点什么

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

  • 2023-10-13
    浙江
  • 本文字数:3376 字

    阅读完需:约 11 分钟

"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 安装视频指南


  • 常规安装


#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 --versionsudo 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/metagptcd metagptpip install -e.
复制代码


Note:


  • If already have Chrome, Chromium, or MS Edge installed, you can skip downloading Chromium by setting the environment variablePUPPETEER_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"
复制代码


  • 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


    pip install playwright
复制代码


- **Install the Required Browsers**
to support PDF conversion, please install Chrominum.
复制代码


    playwright install --with-deps chromium
复制代码


- **modify `config.yaml`**
uncomment MERMAID_ENGINE from config.yaml and change it to `playwright`
复制代码


    MERMAID_ENGINE: playwright
复制代码


  • pyppeteer

  • Install pyppeteer


    pip install pyppeteer
复制代码


- **Use your own Browsers**
pyppeteer alow you use installed browsers, please set the following envirment
复制代码


    export PUPPETEER_EXECUTABLE_PATH = /path/to/your/chromium or edge or chrome
复制代码


please do not use this command to install browser, it is too old
复制代码


    pyppeteer-install
复制代码


- **modify `config.yaml`**
uncomment MERMAID_ENGINE from config.yaml and change it to `pyppeteer`
复制代码


    MERMAID_ENGINE: pyppeteer
复制代码


  • mermaid.ink

  • modify config.yaml

  • uncomment MERMAID_ENGINE from config.yaml and change it to ink


    MERMAID_ENGINE: ink
复制代码


Note: this method does not support pdf export.
复制代码

1.2 Docker 安装指南

#Step 1: Download metagpt official image and prepare config.yamldocker pull metagpt/metagpt:latestmkdir -p /opt/metagpt/{config,workspace}docker run --rm metagpt/metagpt:latest cat /app/metagpt/config/config.yaml > /opt/metagpt/config/key.yamlvim /opt/metagpt/config/key.yaml # Change the config
#Step 2: Run metagpt demo with containerdocker 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 itdocker 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 构造自定义

#You can also build metagpt image by yourself.git clone https://github.com/geekan/MetaGPT.gitcd 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


#Copy the configuration file and make the necessary modifications.cp config/config.yaml config/key.yaml
复制代码


2.相关教程

#Run the scriptpython startup.py "Write a cli snake game"#Do not hire an engineer to implement the projectpython startup.py "Write a cli snake game" --implement False#Hire an engineer and perform code reviewspython 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.


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
复制代码

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://huggingface.co/spaces/deepwisdom/MetaGPT


  • 相关链接


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



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

发布于: 刚刚阅读数: 5
用户头像

本博客将不定期更新关于NLP等领域相关知识 2022-01-06 加入

本博客将不定期更新关于机器学习、强化学习、数据挖掘以及NLP等领域相关知识,以及分享自己学习到的知识技能,感谢大家关注!

评论

发布
暂无评论
MetaGPT( The Multi-Agent Framework):颠覆AI开发的革命性多智能体元编程框架_人工智能_汀丶人工智能_InfoQ写作社区