Skip to content

Commit

Permalink
set enus as default dir
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolee1231 committed Dec 13, 2023
1 parent a20cda9 commit ae33653
Show file tree
Hide file tree
Showing 38 changed files with 309 additions and 170 deletions.
27 changes: 14 additions & 13 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Logo = `
`;

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

// route based on fs, so copy files when deploy
if (process.env.NODE_ENV === 'production') {
Expand All @@ -41,27 +41,28 @@ export default defineConfig({
root: {
label: 'English',
lang: 'en',
link: '/enus/',
themeConfig: {
nav: [
{
text: 'Docs',
link: '/guide/get_started/introduction',
activeMatch: '/guide/',
link: '/enus/guide/get_started/introduction',
activeMatch: '/enus/guide/',
},
{
text: 'Blog',
link: '/blog/agents',
activeMatch: '/blog/',
link: '/enus/blog/agents',
activeMatch: '/enus/blog/',
},
{
text: 'RFCs',
link: '/rfcs/RFC-116-MetaGPT优化方案',
activeMatch: '/rfcs/',
link: '/enus/rfcs/RFC-116-MetaGPT优化方案',
activeMatch: '/enus/rfcs/',
},
],
sidebar: {
'/guide/': {
base: '/guide/',
'/enus/guide/': {
base: '/enus/guide/',
items: [
{
text: 'Get Started',
Expand Down Expand Up @@ -176,17 +177,17 @@ export default defineConfig({
},
],
},
'/blog/': {
base: '/blog/',
'/enus/blog/': {
base: '/enus/blog/',
items: [
{
text: 'Agents',
link: 'agents',
},
],
},
'/rfcs/': {
base: '/rfcs/',
'/enus/rfcs/': {
base: '/enus/rfcs/',
items: [
{
text: 'RFC-116-MetaGPT优化方案',
Expand Down
1 change: 1 addition & 0 deletions src/guide/api.md → src/enus/guide/api.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# API

Will be updated soon, stay tuned.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Contribute Guide

Will be updated soon, stay tuned.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/guide/faq.md → src/enus/guide/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ MetaGPT Community - The position of Chief Evangelist rotates on a monthly basis.

The official OPENAI_API_BASE address is `https://api.openai.com/v1`

If the official OPENAI_API_BASE address is inaccessible in your environment (this can be verified with curl), it's recommended to configure using the reverse proxy OPENAI_API_BASE provided by libraries such as openai-forward. For instance, ` OPENAI_API_BASE: "``https://api.openai-forward.com/v1``" `
If the official OPENAI_API_BASE address is inaccessible in your environment (this can be verified with curl), it's recommended to configure using the reverse proxy OPENAI_API_BASE provided by libraries such as openai-forward. For instance, `OPENAI_API_BASE: "``https://api.openai-forward.com/v1``"`

If the official OPENAI_API_BASE address is inaccessible in your environment (again, verifiable via curl), another option is to configure the OPENAI_PROXY parameter. This way, you can access the official OPENAI_API_BASE via a local proxy. If you don't need to access via a proxy, please do not enable this configuration; if accessing through a proxy is required, modify it to the correct proxy address. Note that when OPENAI_PROXY is enabled, don't set OPENAI_API_BASE.

Note: OpenAI's default API design ends with a v1. An example of the correct configuration is: ` OPENAI_API_BASE: "``https://api.openai.com/v1``" `
Note: OpenAI's default API design ends with a v1. An example of the correct configuration is: `OPENAI_API_BASE: "``https://api.openai.com/v1``"`

- **Absolutely! How can I assist you today?**

Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
# Installation

We provide several ways for installing MetaGPT, please take the one most convenient to your case.

## Support system and version
| System Version | Python Version | Supported |
| ---- | ---- | ----- |
| macOS 13.x | python 3.9 | Yes |
| Windows 11 | python 3.9 | Yes |
| Ubuntu 22.04 | python 3.9 | Yes |

| System Version | Python Version | Supported |
| -------------- | -------------- | --------- |
| macOS 13.x | python 3.9 | Yes |
| Windows 11 | python 3.9 | Yes |
| Ubuntu 22.04 | python 3.9 | Yes |

Ensure that Python 3.9+ is installed on your system. You can check this by using:

```
python3 --version
```

## Install stable version

Recommended for most users. You can import MetaGPT like any python package, employ teams of diverse built-in roles, and build your own agents to serve all kinds of application.

```
pip install metagpt
```

## Install latest development version

Best for experiencing newest features.

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

## Install in development mode

Recommended for developers and researchers looking to customize the framework for their unique requirements, experiment on new ideas, or create sophisticated functionalities like a novel memory mechanism using the framework.

```
git clone https://github.com/geekan/MetaGPT.git
cd /your/path/to/MetaGPT
pip install -e .
```

## Install with Docker

### Use default MetaGPT image

```bash
Expand Down Expand Up @@ -75,35 +87,45 @@ git clone https://github.com/geekan/MetaGPT.git
cd MetaGPT && docker build -t metagpt:custom .
```


## Installation for full features

This is relevant if you want to generate diagrams such as quadrant chart, system designs, sequence flow, etc. They are provided as intermediate results if you run the [software startup example](https://github.com/geekan/MetaGPT/blob/main/startup.py).

### Mermaid

Mermaid is a language that uses text to generate flowcharts, pie charts, Gantt charts, and other diagrams. MetaGPT uses Mermaid to create flowcharts, sequence diagrams, Gantt charts, etc. Mermaid is implemented in Node.js, and direct installation can be somewhat costly. MetaGPT provides the following Mermaid Engines to convert Mermaid text into diagrams:

**nodejs**
Install mermaid-cli directly through nodejs. MetaGPT calls the command line to turn Mermaid text into diagrams. You need to install nodejs first, then use npm to install:

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

The official method provided by mermaid, installed via nodejs, thus it basically supports all platforms and also supports output in png/svg/pdf formats. However, it requires the installation of nodejs and mermaid-cli, which comes with certain costs for installation and use, and also requires a browser environment at runtime.

**pyppeteer**
Mermaid can also be called via JavaScript, and pyppeteer is a web automation testing tool implemented in Python that can execute JavaScript scripts. Therefore, using pyppeteer + mermaidjs can convert Mermaid text into diagrams. You can install pyppeteer with pip:

```
pip install pyppeteer
```

This method is relatively simple to install, has no platform restrictions, and supports output in png/svg/pdf formats. However, it requires a dependency on a browser, so you need to install a browser first and set the browser path when running:

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

(Note: pyppeteer is no longer maintained)

**playwright**
As pyppeteer is no longer maintained, it recommends using playwright-python as a replacement. The principle of running mermaid with playwright is the same as with pyppeteer. However, playwright-python requires the installation of its own provided browser and cannot use an already installed browser. The official only supports the following platforms:

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

```
pip install playwright
playwright install --with-deps chromium
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@

# Quickstart

## Installation

```
pip install metagpt
```
Available installation methods can be found in the [Installation](./installation) section

Available installation methods can be found in the [Installation](./installation) section

## Setup

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

Variations for setting up LLM API (OpenAI, Azure, Anthropic, etc.) and other components can be found in the [Setup](./setup) section.

We use environment variables for a quick demo. For formal usage of MetaGPT, we recommend using a config or key file. See [Setup](./setup).

## Develop software with a one-line requirement
>Note:

> Note:
>
>Below is a breakdown of the [software startup example](https://github.com/geekan/MetaGPT/blob/main/startup.py). If you install MetaGPT with the git clone approach, simply run
>```
>python startup.py --idea "write a cli blackjack game"
>```
Now, let's get started! We will create a team of agents to write software based on one line of our instruction.
> Below is a breakdown of the [software startup example](https://github.com/geekan/MetaGPT/blob/main/startup.py). If you install MetaGPT with the git clone approach, simply run
>
> ```
> python startup.py --idea "write a cli blackjack game"
> ```
>
> Now, let's get started! We will create a team of agents to write software based on one line of our instruction.
First, import off-the-shelf roles

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

Next, initiate the team, equip it with agents, set their budget, and provide our requirement of writing a small game

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

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

Finally, run it and get the code!

```python
await startup(idea="write a cli blackjack game")
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,55 @@
# Setup

Using MetaGPT involves connecting with model providers. We will walk through the setup in this page.

## Setup for LLM API

We will take OpenAI API as an example. You can finish the setup in either way:

1. Use environment variables. This can be used temporarily for a quick start or trying out a demo.
2. Use a config or key file. This is the recommended way, best for continuous and full-feature usage and development.

### 1. Use environment variables

Run in command line:

```shell
export OPENAI_API_KEY="sk-..." # YOUR_API_KEY
export OPENAI_API_MODEL="intended model" # gpt-4, gpt-3.5-turbo, etc.
```

Or in python:

```python
import os
os.environ["OPENAI_API_KEY"] = "sk-..." # YOUR_API_KEY
os.environ["OPENAI_API_MODEL"] = "intended model" # gpt-4, gpt-3.5-turbo, etc.
```

### 2. Use a config or key file

1. In your current working directory, create a folder `config` and add a new file named `config.yaml` or `key.yaml` under it.
2. Copy the content from the example [config.yaml](https://github.com/geekan/MetaGPT/blob/main/config/config.yaml) file into your new files
3. Fill in your own values to the file:

```yaml
OPENAI_API_KEY: "sk-..." # YOUR_API_KEY
OPENAI_API_MODEL: "intended model" # gpt-4, gpt-3.5-turbo, etc.
OPENAI_API_KEY: 'sk-...' # YOUR_API_KEY
OPENAI_API_MODEL: 'intended model' # gpt-4, gpt-3.5-turbo, etc.
```
Remember: If you follow the `git clone` approach in [Installation](./installation), `config/config.yaml` will already be there. Just edit it or make a copy named `config/key.yaml` for editting. This way you don't accidentally commit and share your API key using git.

> Note:
> MetaGPT will read your setup in this priority order: `config/key.yaml > config/config.yaml > environment variable`

Here you are good to go! See [Quickstart](./quickstart) or our [Tutorials](/guide/tutorials/agent_101) for your first run!

## Setup for different model providers

### OpenAI

### Azure

### Anthropic

## Setup for other APIs
## Setup for other APIs
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Agent Communication

Will be updated soon, stay tuned.
1 change: 1 addition & 0 deletions src/enus/guide/in_depth_guides/memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Memory
1 change: 1 addition & 0 deletions src/enus/guide/in_depth_guides/use_own_llm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Use Your Own LLM
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ After this tutorial, you will be able to:
2. Develop your first agent capable of one or more actions

## Use off-the-shelf agents

Import any role, initialize it, run it with a starting message, done!

```python
Expand All @@ -25,6 +26,7 @@ if __name__ == '__main__':
```

## Develop your first agent

Consider agent from a practical usage viewpoint, what are the bare essentials for an agent to be of any utility to us? From MetaGPT's standpoint, if an agent can execute certain actions (whether powered by LLM or otherwise), it holds some degree of usefulness. Put it simply, we define what actions our agent is expected to possess, equip the agent with these capabilities, and we have a basic useful agent! MetaGPT provides high flexibility to define your own action and your own agent. We will walk you through this in the rest of this section.

### Flowchart of one agent run cycle
Expand Down Expand Up @@ -217,4 +219,4 @@ python examples/build_customized_agent.py --msg "write a function that calculate

Or try it on Colab

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1SF3bJiDjKw6Xwnz2Rf0j8Hc0U4KsSB2L?usp=sharing)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1SF3bJiDjKw6Xwnz2Rf0j8Hc0U4KsSB2L?usp=sharing)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Three react modes

## Customize thinking process
## Customize thinking process
File renamed without changes.
Loading

0 comments on commit ae33653

Please sign in to comment.