Begin: 目标和提纲

Untitled

Untitled

Untitled

1. 前期准备

安装 & 配置

pip install -i <https://pypi.tuna.tsinghua.edu.cn/simplemetagpt==0.5.2>  #(推荐)
#metagpt 0.5.2 需要openai 0.28.1
# 注意,metagpt 0.5.2版本使用的openai是0.28.1,安装metagpt 0.5.2会将系统内的openai覆盖为0.28.1
# 注意, openai v1之后的api和v1之前的版本使用有很大区别

# 安装方法还包括,基于git安装unstable版,基于docker安装;
# e.g.
git clone <https://github.com/geekan/MetaGPT.git>
cd /your/path/to/MetaGPT
# -e: Install a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url.
pip install -e .

作业1:cli blackjack game

pip freeze > requirements.txt 输出内容过多,以下packages即可;

python 3.9.10. # pyenv versions

# requirements.txt
metagpt==0.5.2. # 会自动安装upate openai为0.28.1
asyncio

# 由于metagpt的产出文档设计阶段,依赖mermaid表达各类流程图,以及需要将流程图转换成图片或pdf等文档
# 安装mermaid
nodejs v19.3.0. # nvm ls
npm v9.2.0

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

# pyppeteer or playwright: 用于转换mermaid text to picture
# pypeteer:
pip install pyppeteer
# and:
# pyppeteer 依赖os环境中已经安装的浏览器,e.g. chrome
# 注意, pypeteer 已经处于不维护状态
export PUPPETEER_EXECUTABLE_PATH=/path/to/your/chromium  # or edge or chrome

# playwright:
pip install playwright
# playwright需要自己版本的chrome,而不是依赖系统中已经安装的;
playwright install --with-deps chromium

# todo: what is playwright