Skip to content

Commit

Permalink
Merge pull request #167 from HuiDBK/feat-opt_docs
Browse files Browse the repository at this point in the history
Feat opt docs
  • Loading branch information
better629 authored Oct 31, 2024
2 parents 0ce63e2 + 2c00034 commit 03ceca2
Show file tree
Hide file tree
Showing 30 changed files with 70 additions and 14 deletions.
6 changes: 5 additions & 1 deletion src/en/guide/in_depth_guides/breakpoint_recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ When the program is interrupted or terminated, the file structure in the storage
team.json # Contains information such as team, environment, roles, actions, etc.
```

Example of data summary corresponding to `team.json`.
<details>

<summary>Example of data summary corresponding to team.json </summary>

```json
{
Expand Down Expand Up @@ -140,6 +142,8 @@ Example of data summary corresponding to `team.json`.
}
```

</details>

### Execution order during recovery

Since MetaGPT is an asynchronous execution framework, there are several typical interception points and recovery sequences as follows.
Expand Down
2 changes: 1 addition & 1 deletion src/en/guide/in_depth_guides/rag_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This article focuses on the RAG functions provided by the current MetaGPT:
4. Data update, addition of text and Python objects.
5. Data storage and recovery, vectorization is not required each time.

For more examples, please see [rag_pipeline](https://github.com/geekan/MetaGPT/blob/main/examples/rag_pipeline.py) and [rag_search](https://github.com/geekan/MetaGPT/blob/main/examples/rag_search.py)
For more examples, please see [rag_pipeline](https://github.com/geekan/MetaGPT/blob/main/examples/rag/rag_pipeline.py) and [rag_search](https://github.com/geekan/MetaGPT/blob/main/examples/rag/rag_search.py)

## Prepare

Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/crawl_webpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Retrieve paper information containing the keywords: `multiagent` and `large lang

### Code

[examples/di/crawl_webpage.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/crawl_webpage.py)

```bash
python examples/di/crawl_webpage.py
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use `DataInterpreter` to perform a simple data analysis and visualize the sklear
python examples/di/data_visualization.py
```

The code in `examples/di/data_visualization.py` is as follows:
The code in [examples/di/data_visualization.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/data_visualization.py) is as follows:

```python
import asyncio
Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/email_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ After logging into the email, display the sender and the body of the latest 5 em

### Code

[examples/di/email_summary.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/email_summary.py)

```bash
python examples/di/email_summary.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/human_interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ We use the same [machine learning scenario](./machine_learning.md) as an example

### Code

[examples/di/machine_learning.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/machine_learning.py)

```
python examples/di/machine_learning.py --auto_run False
```
Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/image_removebg.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Use `DataInterpreter` to remove background from a picture of a dog.

### Code

[examples/di/rm_image_background.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/rm_image_background.py)

```bash
python examples/di/rm_image_background.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/imitate_webpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Given a URL or an image of a webpage, use the MetaGPT tool integrated with GPT-4

### Code

[examples/di/imitate_webpage.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/imitate_webpage.py)

```bash
python examples/di/imitate_webpage.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/machine_learning.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ We use the [sklearn wine recognition dataset](https://scikit-learn.org/stable/da

### Code

[examples/di/machine_learning.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/machine_learning.py)

```bash
python examples/di/machine_learning.py
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Use `DataInterpreter` to model and predict the [titanic](https://www.kaggle.com/

### Code

[examples/di/machine_learning_with_tools.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/machine_learning_with_tools.py)

```bash
python examples/di/machine_learning_with_tools.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/ocr_receipt.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Use `DataInterpreter` to perform OCR recognition on the following receipt, extra

### Code

[examples/di/ocr_receipt.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/ocr_receipt.py)

> Note: You need to install Paddle-related dependencies to run this example, execute
> `pip install metagpt[ocr]`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ At a school, all 60 students play on at least one of three teams: Basketball, So

### Code

[examples/di/solve_math_problems.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/solve_math_problems.py)

```bash
python examples/di/solve_math_problems.py
```

```python
import asyncio

Expand Down
2 changes: 2 additions & 0 deletions src/en/guide/use_cases/agent/interpreter/text2image.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Use the text-to-image tool of stable diffusion to generate an image from a given

### Code

[examples/di/sd_tool_usage.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/sd_tool_usage.py)

```bash
python examples/di/sd_tool_usage.py
```
Expand Down
4 changes: 2 additions & 2 deletions src/en/guide/use_cases/agent/receipt_assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Supports OCR recognition of invoice files in `pdf`, `png`, `jpg`, and `zip` form

### Source Code

[GitHub Source Code](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/invoice_ocr_assistant.py)
[metagpt/roles/invoice_ocr_assistant.py](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/invoice_ocr_assistant.py)

## Role Definition

Expand Down Expand Up @@ -292,7 +292,7 @@ Supports OCR recognition of invoice files in `pdf`, `png`, `jpg`, and `zip` form

### Execution Command Example

In the project's root directory, execute the command `python3 /examples/invoice_ocr.py`.
In the project's root directory, execute the command `python3 examples/invoice_ocr.py`.

### Execution Results

Expand Down
6 changes: 4 additions & 2 deletions src/en/guide/use_cases/agent/tutorial_assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The design approach involves using the `LLM` (Large Language Model) to initially

### Source Code

[GitHub Source Code](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/tutorial_assistant.py)
[metagpt/roles/tutorial_assistant.py](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/tutorial_assistant.py)

## Role Definition

Expand Down Expand Up @@ -190,7 +190,9 @@ The design approach involves using the `LLM` (Large Language Model) to initially

### Execution Command Examples

Provide corresponding execution command examples.
```bash
python examples/write_tutorial.py
```

### Execution Results

Expand Down
6 changes: 5 additions & 1 deletion src/zh/guide/in_depth_guides/breakpoint_recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
team.json # 包含团队、环境、角色、动作等信息
```

`team.json`对应内容的数据概要示例。
<details>

<summary>team.json 对应内容的数据概要示例。</summary>

```json
{
Expand Down Expand Up @@ -140,6 +142,8 @@
}
```

</details>

### 恢复时的执行顺序

由于MetaGPT是异步执行框架,对于下述几种典型的中断截点和恢复顺序。
Expand Down
2 changes: 1 addition & 1 deletion src/zh/guide/in_depth_guides/rag_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RAG(Retrieval-Augmented Generation)通过引用外部权威知识库来优
4. 数据更新,增加文本与python对象
5. 数据保存及恢复,不用每次都进行向量化

更多的例子请查看 [rag_pipeline](https://github.com/geekan/MetaGPT/blob/main/examples/rag_pipeline.py)[rag_search](https://github.com/geekan/MetaGPT/blob/main/examples/rag_search.py)
更多的例子请查看 [rag_pipeline](https://github.com/geekan/MetaGPT/blob/main/examples/rag/rag_pipeline.py)[rag_search](https://github.com/geekan/MetaGPT/blob/main/examples/rag/rag_search.py)

## 前置准备

Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/crawl_webpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### 代码

[examples/di/crawl_webpage.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/crawl_webpage.py)

```bash
python examples/di/crawl_webpage.py
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
python examples/di/data_visualization.py
```

`examples/di/data_visualization.py`文件中的代码具体为:
[examples/di/data_visualization.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/data_visualization.py) 文件中的代码具体为:

```python
import asyncio
Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/email_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### 代码

[examples/di/email_summary.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/email_summary.py)

```bash
python examples/di/email_summary.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/human_interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### 代码

[examples/di/machine_learning.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/machine_learning.py)

```
python examples/di/machine_learning.py --auto_run False
```
Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/image_removebg.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### 代码

[examples/di/rm_image_background.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/rm_image_background.py)

```bash
python examples/di/rm_image_background.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/imitate_webpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### 代码

[examples/di/imitate_webpage.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/imitate_webpage.py)

```bash
python examples/di/imitate_webpage.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/machine_learning.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### 代码

[examples/di/machine_learning.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/machine_learning.py)

```bash
python examples/di/machine_learning.py
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 代码

[examples/di/machine_learning_with_tools.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/machine_learning_with_tools.py)

```bash
python examples/di/machine_learning_with_tools.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/ocr_receipt.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ OCR,是一种识别图片中文字,得到结构化文本信息的技术手

### 代码

[examples/di/ocr_receipt.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/ocr_receipt.py)

> 注意:你需要事先安装Paddle相关依赖以运行此示例,可执行
> `pip install metagpt[ocr]`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ At a school, all 60 students play on at least one of three teams: Basketball, So

### 代码

[examples/di/solve_math_problems.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/solve_math_problems.py)

```bash
python examples/di/solve_math_problems.py
```
Expand Down
2 changes: 2 additions & 0 deletions src/zh/guide/use_cases/agent/interpreter/text2image.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Text2Image,指通过文字描述获取图片

### 代码

[examples/di/sd_tool_usage.py](https://github.com/geekan/MetaGPT/blob/main/examples/di/sd_tool_usage.py)

```bash
python examples/di/sd_tool_usage.py
```
Expand Down
4 changes: 2 additions & 2 deletions src/zh/guide/use_cases/agent/receipt_assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

### 源码

[GitHub Source Code](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/invoice_ocr_assistant.py)
[metagpt/roles/invoice_ocr_assistant.py](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/invoice_ocr_assistant.py)

## 角色定义

Expand Down Expand Up @@ -301,7 +301,7 @@

### 执行命令样例

在项目根目录下,执行命令行 `python3 /examples/invoice_ocr.py`
在项目根目录下,执行命令行 `python3 examples/invoice_ocr.py`

### 执行结果

Expand Down
6 changes: 4 additions & 2 deletions src/zh/guide/use_cases/agent/tutorial_assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### 源码

[GitHub Source Code](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/tutorial_assistant.py)
[metagpt/roles/tutorial_assistant.py](https://github.com/geekan/MetaGPT/blob/main/metagpt/roles/tutorial_assistant.py)

## 角色定义

Expand Down Expand Up @@ -195,7 +195,9 @@

### 执行命令样例

贴对应的执行命令样例
```bash
python examples/write_tutorial.py
```

### 执行结果

Expand Down

0 comments on commit 03ceca2

Please sign in to comment.