Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change folder name and path #35

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const Logo = `
`;

const sources = ['blog', 'rfcs'];
const dests = ['zhcn', 'enus'];
const dests = ['zh', 'en'];

// route based on fs, so copy files when deploy
if (process.env.NODE_ENV === 'production') {
/** for deploy */
cpSync(
resolve(__dirname, '../src/enus/index.md'),
resolve(__dirname, '../src/en/index.md'),
resolve(__dirname, '../src/index.md')
);
for (const source of sources) {
Expand Down Expand Up @@ -89,24 +89,24 @@ export default defineConfig({
root: {
label: 'English',
lang: 'en',
link: '/enus/',
link: '/en/',
themeConfig: {
nav: [
{
text: 'Docs',
link: '/enus/guide/get_started/introduction',
activeMatch: '/enus/guide/',
link: '/en/guide/get_started/introduction',
activeMatch: '/en/guide/',
},
...arrVisible(
[
{
text: 'Blog',
link: '/enus/blog/agents',
link: '/en/blog/agents',
activeMatch: '/blog/',
},
{
text: 'RFCs',
link: '/enus/rfcs/RFC-116-MetaGPT优化方案',
link: '/en/rfcs/RFC-116-MetaGPT优化方案',
activeMatch: '/euns/rfcs/',
},
],
Expand All @@ -115,8 +115,8 @@ export default defineConfig({
...getVersions(),
],
sidebar: {
'/enus/guide/': {
base: '/enus/guide/',
'/en/guide/': {
base: '/en/guide/',
items: [
{
text: 'Get Started',
Expand Down Expand Up @@ -231,17 +231,17 @@ export default defineConfig({
},
],
},
'/enus/blog/': {
base: '/enus/blog/',
'/en/blog/': {
base: '/en/blog/',
items: [
{
text: 'Agents',
link: 'agents',
},
],
},
'/enus/rfcs/': {
base: '/enus/rfcs/',
'/en/rfcs/': {
base: '/en/rfcs/',
items: [
{
text: 'RFC-116-MetaGPT优化方案',
Expand All @@ -252,37 +252,37 @@ export default defineConfig({
},
},
},
zhcn: {
zh: {
label: '中文',
lang: 'zhcn',
link: '/zhcn/',
lang: 'zh',
link: '/zh/',
themeConfig: {
nav: [
{
text: '文档',
link: '/zhcn/guide/get_started/introduction',
activeMatch: '/zhcn/guide/',
link: '/zh/guide/get_started/introduction',
activeMatch: '/zh/guide/',
},
...arrVisible(
[
{
text: '博客',
link: '/zhcn/blog/agents',
activeMatch: '/zhcn/blog/',
link: '/zh/blog/agents',
activeMatch: '/zh/blog/',
},
{
text: 'RFCs',
link: '/zhcn/rfcs/RFC-116-MetaGPT优化方案',
activeMatch: '/zhcn/rfcs/',
link: '/zh/rfcs/RFC-116-MetaGPT优化方案',
activeMatch: '/zh/rfcs/',
},
],
blogAndRfcVisible
),
...getVersions(),
],
sidebar: {
'/zhcn/guide/': {
base: '/zhcn/guide/',
'/zh/guide/': {
base: '/zh/guide/',
items: [
{
text: '开始',
Expand Down Expand Up @@ -418,17 +418,17 @@ export default defineConfig({
},
],
},
'/zhcn/blog/': {
base: '/zhcn/blog/',
'/zh/blog/': {
base: '/zh/blog/',
items: [
{
text: 'Agents',
link: 'agents',
},
],
},
'/zhcn/rfcs/': {
base: '/zhcn/rfcs/',
'/zh/rfcs/': {
base: '/zh/rfcs/',
items: [
{
text: 'RFC-116-MetaGPT优化方案',
Expand Down
4 changes: 2 additions & 2 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@
}
}

html[lang='zhcn'] .VPHome .text {
html[lang='zh'] .VPHome .text {
line-height: 128px;
}

/* html[lang='zhcn'] .VPHome .tagline {
/* html[lang='zh'] .VPHome .tagline {
line-height: 72px;
} */
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/enus/index.md → src/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hero:
actions:
- theme: brand
text: Get Started
link: /enus/guide/get_started/introduction
link: /en/guide/get_started/introduction
- theme: alt
text: View on Github
link: https://github.com/geekan/MetaGPT
Expand Down
1 change: 1 addition & 0 deletions src/zhcn/guide/api.md → src/zh/guide/api.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# API

即将更新,保持关注。
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# 贡献指南

即将更新,保持关注。
51 changes: 51 additions & 0 deletions src/zh/guide/contribute/rfc_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 开发者RFC模版

文档修改历史

| 日期 | 版本 | 作者 | 修改内容 |
| ---------- | ------ | ---- | -------- |
| 2023/09/13 | v0.0.1 | | 初版 |
| | | | |

本文档评审记录

| 审核人 | 邀请日期 | 审核日期 | 审核意见 |
| ------ | ---------- | -------- | -------- |
| @xxx | 2023/09/13 | | |
| | | | |

# 背景

# 目标

## 定义

### 包括的

### 不包括的

## 有则更优

# 提案

3.1

3.2

# 里程碑[可选]

# 开放讨论

# 附录[可选]

## 术语

| 术语 | 全称 | 解释 |
| ---- | ---- | ---- |
| | | |
| | | |
| | | |
| | | |
| | | |

## 参考
4 changes: 4 additions & 0 deletions src/zh/guide/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 常见问题解答(FAQ)

详见
https://deepwisdom.feishu.cn/wiki/MsGnwQBjiif9c3koSJNcYaoSnu4
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@

# 安装

我们提供了几种安装MetaGPT的方式,请选择最适合你的方式。

## 支持的系统和版本

| 系统版本 | Python版本 | 是否支持 |
| ---- | ---- | ----- |
| macOS 13.x | python 3.9 | |
| Windows 11 | python 3.9 | |
| Ubuntu 22.04 | python 3.9 | |
| 系统版本 | Python版本 | 是否支持 |
| ------------ | ---------- | -------- |
| macOS 13.x | python 3.9 | 是 |
| Windows 11 | python 3.9 | 是 |
| Ubuntu 22.04 | python 3.9 | 是 |

请确保你的系统已安装Python 3.9+。你可以通过以下命令进行检查:

```
python3 --version
```

## 安装稳定版本

推荐大多数用户使用。你可以像使用任何python包一样导入MetaGPT,使用各种内置角色或团队,并构建自己的智能体来服务各种应用。

```
pip install metagpt
```

## 安装最新的开发版本

最适合体验最新功能的用户。

```
pip install git+https://github.com/geekan/MetaGPT
```

## 以开发模式安装

推荐给那些想要根据自己的独特需求定制框架、尝试新的想法或者利用框架创建复杂功能(如新颖的记忆机制)的开发者和研究者。

```
git clone https://github.com/geekan/MetaGPT.git
cd /your/path/to/MetaGPT
Expand Down Expand Up @@ -84,7 +87,6 @@ git clone https://github.com/geekan/MetaGPT.git
cd MetaGPT && docker build -t metagpt:custom .
```


## 安装全部功能

如果你想生成一些图表,比如象限图,系统设计图,顺序流程图等,这非常有用。如果你运行[软件启动示例](https://github.com/geekan/MetaGPT/blob/main/metagpt/startup.py),它们将作为中间结果提供给你。
Expand All @@ -95,27 +97,35 @@ Mermaid是一种使用文本生成流程图、饼图、甘特图和其他图表

**nodejs**
通过nodejs直接安装mermaid-cli。MetaGPT调用命令行将Mermaid文本转换为图表。你需要先安装nodejs,然后使用npm进行安装:

```
npm install -g @mermaid-js/mermaid-cli
```

这是mermaid提供的官方方法,通过nodejs安装,因此它基本上支持所有平台,也支持输出png/svg/pdf格式。然而,它需要安装nodejs和mermaid-cli,安装和使用有一定的成本,并且在运行时需要浏览器环境。

**pyppeteer**
Mermaid也可以通过JavaScript调用,pyppeteer是一个用Python实现的web自动化测试工具,可以执行JavaScript脚本。因此,使用pyppeteer + mermaidjs可以将Mermaid文本转换为图表。你可以使用pip安装pyppeteer:

```
pip install pyppeteer
```

这种方法安装相对简单,没有平台限制,并支持输出png/svg/pdf格式。然而,它需要依赖于浏览器,所以你需要先安装一个浏览器,并在运行时设置浏览器路径:

```
export PUPPETEER_EXECUTABLE_PATH=/path/to/your/chromium # 或者edge或chrome
```

(注意:pyppeteer已经不再维护)

**playwright**
由于pyppeteer已经不再维护,它推荐使用playwright-python作为替代。使用playwright运行mermaid的原理与pyppeteer相同。然而,playwright-python需要安装其自己提供的浏览器,不能使用已经安装的浏览器。官方只支持以下平台:

- Windows 10+,Windows Server 2016+或Windows Subsystem for Linux (WSL)。
- MacOS 12 Monterey或MacOS 13 Ventura。
- Debian 11,Debian 12,Ubuntu 20.04或Ubuntu 22.04。

```
pip install playwright
playwright install --with-deps chromium
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@

# 快速开始

## 安装

```
pip install metagpt
```

完整的安装方法可在 [安装](./installation) 部分找到。

## 配置

```
import os
os.environ["OPENAI_API_KEY"] = "sk-..."
os.environ["OPENAI_API_MODEL"] = "gpt-4"
```

完整配置不同LLM API(比如OpenAI、Azure、Anthropic等)的方法可在 [配置](./setup) 部分找到。

## 一句话需求的软件开发
>注意:

> 注意:
>
>下面为 [software startup example](https://github.com/geekan/MetaGPT/blob/main/metagpt/startup.py) 的节选。如果你使用`git clone`方法进行安装,只需简单执行
>```
>metagpt --idea "write a cli blackjack game"
>```
现在,让我们开始吧!我们将创建一个多智能体团队,根据我们的一句话需求编写软件。
> 下面为 [software startup example](https://github.com/geekan/MetaGPT/blob/main/metagpt/startup.py) 的节选。如果你使用`git clone`方法进行安装,只需简单执行
>
> ```
> metagpt --idea "write a cli blackjack game"
> ```
>
> 现在,让我们开始吧!我们将创建一个多智能体团队,根据我们的一句话需求编写软件。

首先,导入已实现的角色

```python
import asyncio
from metagpt.roles import (
Expand All @@ -34,7 +42,9 @@ from metagpt.roles import (
)
from metagpt.team import Team
```

然后,初始化公司团队,配置对应的智能体,设置对应的预算以及提供一个写一个小游戏的需求。

```python
async def startup(idea: str):
company = Team()
Expand All @@ -51,7 +61,9 @@ async def startup(idea: str):

await company.run(n_round=5)
```

最后,运行并得到生成的游戏代码!

```python
await startup(idea="write a cli blackjack game") # blackjack: 二十一点
```
Expand Down
Loading
Loading