Skip to content

Commit

Permalink
refine dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
geekan committed Jul 3, 2023
1 parent 3eea4c0 commit 0205b7e
Show file tree
Hide file tree
Showing 65 changed files with 149 additions and 149 deletions.
83 changes: 37 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,111 +1,102 @@
# MetaGPT:多智能体元编程框架
# MetaGPT: The Multi-Agent Meta Programming Framework

<p align="center">
<a href=""><img src="resources/MetaGPT-logo.jpeg" alt="MetaGPT logo: 使 GPT 以软件公司的形式工作,协作处理更复杂的任务" width="150px"></a>
<a href=""><img src="docs/resources/MetaGPT-logo.jpeg" alt="MetaGPT logo: Enable GPT to work in software company, collaborating to tackle more complex tasks." width="150px"></a>
</p>

<p align="center">
<b>使 GPTs 组成软件公司,协作处理更复杂的任务</b>
<b>Make GPTs form a software company to collaboratively handle more complex tasks.</b>
</p>

<p align="center">
<a href="README.md"><img src="https://img.shields.io/badge/文档-中文版-blue.svg" alt="CN doc"></a>
<a href="README_EN.md"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a>
<a href="docs/README_CN.md"><img src="https://img.shields.io/badge/文档-中文版-blue.svg" alt="CN doc"></a>
<a href="README.md"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a>
<a href="https://discord.gg/wCp6Q3fsAk"><img src="https://dcbadge.vercel.app/api/server/wCp6Q3fsAk?compact=true&style=flat" alt="Discord Follow"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
<a href="https://twitter.com/DeepWisdom2019"><img src="https://img.shields.io/twitter/follow/MetaGPT?style=social" alt="Twitter Follow"></a>
</p>

1. MetaGPT输入**一句话的老板需求**,输出**用户故事 / 竞品分析 / 需求 / 数据结构 / APIs / 文件等**
2. MetaGPT内部包括**产品经理 / 架构师 / 项目经理 / 工程师**,它提供了一个**软件公司**的全过程与精心调配的SOP
1. `Code = SOP(Team)` 是核心哲学。我们将SOP具象化,并且用于LLM构成的团队
1. MetaGPT takes a **single sentence of a boss's requirement** as input and outputs **user stories / competitive analysis / requirements / data structures / APIs / documents, etc.**
2. Internally, MetaGPT includes **product managers / architects / project managers / engineers.** It provides the entire process of a **software company along with carefully orchestrated SOPs.**
1. `Code = SOP(Team)` is the core philosophy. We materialize SOP and apply it to teams composed of LLMs.

![一个完全由大语言模型角色构成的软件公司](./resources/software_company_cd.jpeg)
![A software company consists of LLM-based roles](docs/resources/software_company_cd.jpeg)

<p align="center">软件公司多角色示意图(正在逐步实现)</p>
<p align="center">Software Company Multi-Role Schematic (Gradually Implementing)</p>

## 示例(均由 GPT-4 生成)
## Examples (fully generated by GPT-4)

例如,键入`python startup.py "写个类似今日头条的推荐系统"`并回车,你会获得一系列输出,其一是数据结构与API设计
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

![今日头条 Recsys 数据 & API 设计](resources/workspace/content_rec_sys/resources/data_api_design.png)
![Jinri Toutiao Recsys Data & API Design](docs/resources/workspace/content_rec_sys/resources/data_api_design.png)

这需要大约**0.2美元**GPT-4 API的费用)来生成一个带有分析和设计的示例,大约2.0美元用于一个完整的项目
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.

## 安装
## Installation

```bash
# 第 1 步:确保您的系统上安装了 NPM。并使用npm安装mermaid-js
# Step 1: Ensure that NPM is installed on your system. Then install mermaid-js.
npm --version
sudo npm install -g @mermaid-js/mermaid-cli

# 第 2 步:确保您的系统上安装了 Python 3.9+。您可以使用以下命令进行检查:
# Step 2: Ensure that Python 3.9+ is installed on your system. You can check this by using:
python --version

# 第 3 步:克隆仓库到您的本地机器,并进行安装。
# 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
```

## 配置
## Configuration

- `config/key.yaml / config/config.yaml / env` 中配置您的 `OPENAI_API_KEY`
- 优先级顺序:`config/key.yaml > config/config.yaml > env`
- Configure your `OPENAI_API_KEY` in any of `config/key.yaml / config/config.yaml / env`
- Priority order: `config/key.yaml > config/config.yaml > env`

```bash
# 复制配置文件并进行必要的修改。
# Copy the configuration file and make the necessary modifications.
cp config/config.yaml config/key.yaml
```

| 变量名 | config/key.yaml | env |
| Variable Name | config/key.yaml | env |
|--------------------------------------------|-------------------------------------------|--------------------------------|
| OPENAI_API_KEY # 用您自己的密钥替换 | OPENAI_API_KEY: "sk-..." | export OPENAI_API_KEY="sk-..." |
| OPENAI_API_BASE # 可选 | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |
| 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" |

## 示例:启动一个创业公司
## Tutorial: Initiating a startup

```shell
python startup.py "写一个命令行贪吃蛇"
python startup.py "Write a cli snake game"
```

运行脚本后,您可以在 `workspace/` 目录中找到您的新项目。
After running the script, you can find your new project in the `workspace/` directory.

### 代码实现
### Code walkthrough

```python
from metagpt.software_company import SoftwareCompany
from metagpt.roles import ProjectManager, ProductManager, Architect, Engineer

async def startup(idea: str, investment: str = '$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)
```

你可以查看`examples`,其中有单角色(带知识库)的使用例子与仅LLM的使用例子。
You can check `examples` for more details on single role (with knowledge base) and LLM only examples.

## 联系信息
## Contact Information

如果您对这个项目有任何问题或反馈,欢迎联系我们。我们非常欢迎您的建议!
If you have any questions or feedback about this project, please feel free to contact us. We highly appreciate your suggestions!

- **邮箱:** [email protected]
- **GitHub 问题:** 对于更技术性的问题,您也可以在我们的 [GitHub 仓库](https://github.com/geekan/metagpt/issues) 中创建一个新的问题。
- **Email:** [email protected]
- **GitHub Issues:** For more technical inquiries, you can also create a new issue in our [GitHub repository](https://github.com/geekan/metagpt/issues).

我们会在2-3个工作日内回复所有问题。
We will respond to all questions within 2-3 business days.

## 演示
## Demo

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

## 加入微信讨论群

- 群已满,加人进群

[//]: # (![MetaGPT WeChat Discuss Group]&#40;./resources/MetaGPT-WeChat-Group.jpeg&#41;{:height="50%" width="50%"})
<img src="./resources/MetaGPT-WeChat-Personal.jpeg" width = "30%" height = "30%" alt="MetaGPT WeChat Discuss Group" align=center />


102 changes: 0 additions & 102 deletions README_EN.md

This file was deleted.

111 changes: 111 additions & 0 deletions docs/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# MetaGPT:多智能体元编程框架

<p align="center">
<a href=""><img src="resources/MetaGPT-logo.jpeg" alt="MetaGPT logo: 使 GPT 以软件公司的形式工作,协作处理更复杂的任务" width="150px"></a>
</p>

<p align="center">
<b>使 GPTs 组成软件公司,协作处理更复杂的任务</b>
</p>

<p align="center">
<a href="README_CN.md"><img src="https://img.shields.io/badge/文档-中文版-blue.svg" alt="CN doc"></a>
<a href="../README.md"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a>
<a href="https://discord.gg/wCp6Q3fsAk"><img src="https://dcbadge.vercel.app/api/server/wCp6Q3fsAk?compact=true&style=flat" alt="Discord Follow"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
<a href="https://twitter.com/DeepWisdom2019"><img src="https://img.shields.io/twitter/follow/MetaGPT?style=social" alt="Twitter Follow"></a>
</p>

1. MetaGPT输入**一句话的老板需求**,输出**用户故事 / 竞品分析 / 需求 / 数据结构 / APIs / 文件等**
2. MetaGPT内部包括**产品经理 / 架构师 / 项目经理 / 工程师**,它提供了一个**软件公司**的全过程与精心调配的SOP
1. `Code = SOP(Team)` 是核心哲学。我们将SOP具象化,并且用于LLM构成的团队

![一个完全由大语言模型角色构成的软件公司](resources/software_company_cd.jpeg)

<p align="center">软件公司多角色示意图(正在逐步实现)</p>

## 示例(均由 GPT-4 生成)

例如,键入`python startup.py "写个类似今日头条的推荐系统"`并回车,你会获得一系列输出,其一是数据结构与API设计

![今日头条 Recsys 数据 & API 设计](resources/workspace/content_rec_sys/resources/data_api_design.png)

这需要大约**0.2美元**(GPT-4 API的费用)来生成一个带有分析和设计的示例,大约2.0美元用于一个完整的项目

## 安装

```bash
# 第 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
```

## 配置

-`config/key.yaml / config/config.yaml / env` 中配置您的 `OPENAI_API_KEY`
- 优先级顺序:`config/key.yaml > config/config.yaml > env`

```bash
# 复制配置文件并进行必要的修改。
cp config/config.yaml config/key.yaml
```

| 变量名 | config/key.yaml | env |
|--------------------------------------------|-------------------------------------------|--------------------------------|
| OPENAI_API_KEY # 用您自己的密钥替换 | OPENAI_API_KEY: "sk-..." | export OPENAI_API_KEY="sk-..." |
| OPENAI_API_BASE # 可选 | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |

## 示例:启动一个创业公司

```shell
python startup.py "写一个命令行贪吃蛇"
```

运行脚本后,您可以在 `workspace/` 目录中找到您的新项目。

### 代码实现

```python
from metagpt.software_company import SoftwareCompany
from metagpt.roles import ProjectManager, ProductManager, Architect, Engineer

async def startup(idea: str, investment: str = '$3.0', n_round: int = 5):
"""运行一个创业公司。做一个老板"""
company = SoftwareCompany()
company.hire([ProductManager(), Architect(), ProjectManager(), Engineer()])
company.invest(investment)
company.start_project(idea)
await company.run(n_round=n_round)
```

你可以查看`examples`,其中有单角色(带知识库)的使用例子与仅LLM的使用例子。

## 联系信息

如果您对这个项目有任何问题或反馈,欢迎联系我们。我们非常欢迎您的建议!

- **邮箱:** [email protected]
- **GitHub 问题:** 对于更技术性的问题,您也可以在我们的 [GitHub 仓库](https://github.com/geekan/metagpt/issues) 中创建一个新的问题。

我们会在2-3个工作日内回复所有问题。

## 演示

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

## 加入微信讨论群

- 群已满,加人进群

[//]: # (![MetaGPT WeChat Discuss Group]&#40;./resources/MetaGPT-WeChat-Group.jpeg&#41;{:height="50%" width="50%"})
<img src="resources/MetaGPT-WeChat-Personal.jpeg" width = "30%" height = "30%" alt="MetaGPT WeChat Discuss Group" align=center />


File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def run(self):

here = path.abspath(path.dirname(__file__))

with open(path.join(here, "README_EN.md"), encoding="utf-8") as f:
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()

with open(path.join(here, "requirements.txt"), encoding="utf-8") as f:
Expand Down

0 comments on commit 0205b7e

Please sign in to comment.