Skip to content

Commit

Permalink
Merge pull request geekan#1182 from garylin2099/code_interpreter
Browse files Browse the repository at this point in the history
Merge main
  • Loading branch information
garylin2099 authored Apr 11, 2024
2 parents 6c2b238 + f87387d commit bf77d2a
Show file tree
Hide file tree
Showing 377 changed files with 15,704 additions and 894 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
*.jpg binary
*.gif binary
*.ico binary
*.jpeg binary
*.mp3 binary
*.zip binary
*.bin binary


# Preserve original line endings for specific document files
*.doc text eol=crlf
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/show_me_the_bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ assignees: ''
- LLM type and model name:
- System version:
- Python version:
- MetaGPT version or branch:

<!-- Dependent packagess:the packages version cause the bug(like `pydantic 1.10.8`), installation method(like `pip install metagpt` or `pip install from source` or `run in docker`) -->

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-package.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Build and upload python package

on:
workflow_dispatch:
release:
types: [created]
types: [created, published]

jobs:
deploy:
Expand Down
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Python template

# Byte-compiled / optimized / DLL files
__pycache__/
__pycache__
*.py[cod]
*$py.class

Expand All @@ -27,6 +27,8 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
metagpt/tools/schemas/
examples/data/search_kb/*.json

# PyInstaller
# Usually these files are written by a python scripts from a template
Expand Down Expand Up @@ -151,9 +153,14 @@ allure-results
.vscode

key.yaml
data
/data/
data.ms
examples/nb/
examples/default__vector_store.json
examples/docstore.json
examples/graph_store.json
examples/image__vector_store.json
examples/index_store.json
.chroma
*~$*
workspace/*
Expand All @@ -168,6 +175,7 @@ output
tmp.png
.dependencies.json
tests/metagpt/utils/file_repo_git
tests/data/rsp_cache_new.json
*.tmp
*.png
htmlcov
Expand All @@ -178,4 +186,5 @@ cov.xml
*.faiss
*-structure.csv
*-structure.json
metagpt/tools/schemas
*.dot
.python-version
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive-include metagpt/ext/stanford_town/prompts *.txt
recursive-include metagpt/ext/stanford_town/static_dirs *.csv
recursive-include metagpt/ext/stanford_town/static_dirs *.json
97 changes: 48 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
</p>

## News
🚀 March. 01, 2024: Our Data Interpreter paper is on arxiv. Find all design and benchmark details [here](https://arxiv.org/abs/2402.18679)!
🚀 Mar. 29, 2024: [v0.8.0](https://github.com/geekan/MetaGPT/releases/tag/v0.8.0) released. Now you can use Data Interpreter via pypi package import. Meanwhile, we integrated RAG module and supported multiple new LLMs.

🚀 Mar. 14, 2024: Our **Data Interpreter** paper is on [arxiv](https://arxiv.org/abs/2402.18679). Check the [example](https://docs.deepwisdom.ai/main/en/DataInterpreter/) and [code](https://github.com/geekan/MetaGPT/tree/main/examples/di)!

🚀 Feb. 08, 2024: [v0.7.0](https://github.com/geekan/MetaGPT/releases/tag/v0.7.0) released, supporting assigning different LLMs to different Roles. We also introduced [Data Interpreter](https://github.com/geekan/MetaGPT/blob/main/examples/di/README.md), a powerful agent capable of solving a wide range of real-world problems.

Expand Down Expand Up @@ -55,88 +57,69 @@

<p align="center">Software Company Multi-Agent Schematic (Gradually Implementing)</p>

## Install
## Get Started

### Pip installation
### Installation

> Ensure that Python 3.9+ is installed on your system. You can check this by using: `python --version`.
> You can use conda like this: `conda create -n metagpt python=3.9 && conda activate metagpt`
```bash
pip install metagpt
# https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html
metagpt --init-config # it will create ~/.metagpt/config2.yaml, just modify it to your needs
pip install --upgrade metagpt
# or `pip install --upgrade git+https://github.com/geekan/MetaGPT.git`
# or `git clone https://github.com/geekan/MetaGPT && cd MetaGPT && pip install --upgrade -e .`
```

For detailed installation guidance, please refer to [cli_install](https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html#install-stable-version)
or [docker_install](https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html#install-with-docker)

### Configuration

You can init the config of MetaGPT by running the following command, or manually create `~/.metagpt/config2.yaml` file:
```bash
# Check https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html for more details
metagpt --init-config # it will create ~/.metagpt/config2.yaml, just modify it to your needs
```

You can configure `~/.metagpt/config2.yaml` according to the [example](https://github.com/geekan/MetaGPT/blob/main/config/config2.example.yaml) and [doc](https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html):

```yaml
llm:
api_type: "openai" # or azure / ollama / open_llm etc. Check LLMType for more options
model: "gpt-4-turbo-preview" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
model: "gpt-4-turbo" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
base_url: "https://api.openai.com/v1" # or forward url / other llm url
api_key: "YOUR_API_KEY"
```
### Usage
After installation, you can use it as CLI
After installation, you can use MetaGPT at CLI
```bash
metagpt "Create a 2048 game" # this will create a repo in ./workspace
```

or you can use it as library
or use it as library

```python
from metagpt.software_company import generate_repo, ProjectRepo
repo: ProjectRepo = generate_repo("Create a 2048 game") # or ProjectRepo("<path>")
print(repo) # it will print the repo structure with files
```

detail installation please refer to [cli_install](https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html#install-stable-version)
or [docker_install](https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html#install-with-docker)

### Docker installation
<details><summary><strong>⏬ Step 1: Download metagpt image and prepare config2.yaml </strong><i>:: click to expand ::</i></summary>
<div>

```bash
docker pull metagpt/metagpt:latest
mkdir -p /opt/metagpt/{config,workspace}
docker run --rm metagpt/metagpt:latest cat /app/metagpt/config/config2.yaml > /opt/metagpt/config/config2.yaml
vim /opt/metagpt/config/config2.yaml # Change the config
```

</div>
</details>
You can also use its [Data Interpreter](https://github.com/geekan/MetaGPT/tree/main/examples/di)

<details><summary><strong>⏬ Step 2: Run metagpt container </strong><i>:: click to expand ::</i></summary>
<div>

```bash
docker run --name metagpt -d \
--privileged \
-v /opt/metagpt/config/config2.yaml:/app/metagpt/config/config2.yaml \
-v /opt/metagpt/workspace:/app/metagpt/workspace \
metagpt/metagpt:latest
```

</div>
</details>
```python
import asyncio
from metagpt.roles.di.data_interpreter import DataInterpreter

<details><summary><strong>⏬ Step 3: Use metagpt </strong><i>:: click to expand ::</i></summary>
<div>
async def main():
di = DataInterpreter()
await di.run("Run data analysis on sklearn Iris dataset, include a plot")

```bash
docker exec -it metagpt /bin/bash
$ metagpt "Create a 2048 game" # this will create a repo in ./workspace
asyncio.run(main()) # or await main() in a jupyter notebook setting
```

</div>
</details>

### QuickStart & Demo Video
- Try it on [MetaGPT Huggingface Space](https://huggingface.co/spaces/deepwisdom/MetaGPT)
Expand All @@ -156,17 +139,21 @@ https://github.com/geekan/MetaGPT/assets/34952977/34345016-5d13-489d-b9f9-b82ace
- 🧑‍💻 Contribution
- [Develop Roadmap](docs/ROADMAP.md)
- 🔖 Use Cases
- [Data Interpreter](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/interpreter/intro.html)
- [Debate](https://docs.deepwisdom.ai/main/en/guide/use_cases/multi_agent/debate.html)
- [Researcher](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/researcher.html)
- [Recepit Assistant](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/receipt_assistant.html)
-[FAQs](https://docs.deepwisdom.ai/main/en/guide/faq.html)

## Support

### Discard Join US
📢 Join Our [Discord Channel](https://discord.gg/ZRHeExS6xv)!
### Discord Join US

📢 Join Our [Discord Channel](https://discord.gg/ZRHeExS6xv)! Looking forward to seeing you there! 🎉

Looking forward to seeing you there! 🎉
### Contributor form

📝 [Fill out the form](https://airtable.com/appInfdG0eJ9J4NNL/pagK3Fh1sGclBvVkV/form) to become a contributor. We are looking forward to your participation!

### Contact Information

Expand All @@ -179,7 +166,9 @@ We will respond to all questions within 2-3 business days.

## Citation

For now, cite the [arXiv paper](https://arxiv.org/abs/2308.00352):
To stay updated with the latest research and development, follow [@MetaGPT_](https://twitter.com/MetaGPT_) on Twitter.

To cite [MetaGPT](https://arxiv.org/abs/2308.00352) or [Data Interpreter](https://arxiv.org/abs/2402.18679) in publications, please use the following BibTeX entries.

```bibtex
@misc{hong2023metagpt,
Expand All @@ -190,4 +179,14 @@ For now, cite the [arXiv paper](https://arxiv.org/abs/2308.00352):
archivePrefix={arXiv},
primaryClass={cs.AI}
}
@misc{hong2024data,
title={Data Interpreter: An LLM Agent For Data Science},
author={Sirui Hong and Yizhang Lin and Bang Liu and Bangbang Liu and Binhao Wu and Danyang Li and Jiaqi Chen and Jiayi Zhang and Jinlin Wang and Li Zhang and Lingyao Zhang and Min Yang and Mingchen Zhuge and Taicheng Guo and Tuo Zhou and Wei Tao and Wenyi Wang and Xiangru Tang and Xiangtao Lu and Xiawu Zheng and Xinbing Liang and Yaying Fei and Yuheng Cheng and Zongze Xu and Chenglin Wu},
year={2024},
eprint={2402.18679},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
```

6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

| Version | Supported |
|---------|--------------------|
| 7.x | :x: |
| 6.x | :x: |
| < 6.x | :x: |
| 0.7.x | :x: |
| 0.6.x | :x: |
| < 0.6.x | :x: |


## Reporting a Vulnerability
Expand Down
11 changes: 11 additions & 0 deletions config/config2.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ llm:
api_key: "YOUR_API_KEY"
model: "gpt-4-turbo-preview" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
proxy: "YOUR_PROXY" # for LLM API requests
# timeout: 600 # Optional. If set to 0, default value is 300.
pricing_plan: "" # Optional. If invalid, it will be automatically filled in with the value of the `model`.
# Azure-exclusive pricing plan mappings:
# - gpt-3.5-turbo 4k: "gpt-3.5-turbo-1106"
Expand All @@ -12,6 +13,16 @@ llm:
# - gpt-4 8k: "gpt-4"
# See for more: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/

# RAG Embedding.
# For backward compatibility, if the embedding is not set and the llm's api_type is either openai or azure, the llm's config will be used.
embedding:
api_type: "" # openai / azure / gemini / ollama etc. Check EmbeddingType for more options.
base_url: ""
api_key: ""
model: ""
api_version: ""
embed_batch_size: 100

repair_llm_output: true # when the output is not a valid json, try to repair it

proxy: "YOUR_PROXY" # for tools like requests, playwright, selenium, etc.
Expand Down
2 changes: 1 addition & 1 deletion config/config2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Reflected Code: https://github.com/geekan/MetaGPT/blob/main/metagpt/config2.py
llm:
api_type: "openai" # or azure / ollama / open_llm etc. Check LLMType for more options
model: "gpt-4-turbo-preview" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
model: "gpt-4-turbo" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
base_url: "https://api.openai.com/v1" # or forward url / other llm url
api_key: "YOUR_API_KEY"
10 changes: 9 additions & 1 deletion docs/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ https://github.com/geekan/MetaGPT/assets/34952977/34345016-5d13-489d-b9f9-b82ace

## 引用

引用 [arXiv paper](https://arxiv.org/abs/2308.00352):
如果您在研究论文中使用 MetaGPT 或 Data Interpreter,请引用我们的工作:

```bibtex
@misc{hong2023metagpt,
Expand All @@ -127,4 +127,12 @@ https://github.com/geekan/MetaGPT/assets/34952977/34345016-5d13-489d-b9f9-b82ace
archivePrefix={arXiv},
primaryClass={cs.AI}
}
@misc{hong2024data,
title={Data Interpreter: An LLM Agent For Data Science},
author={Sirui Hong and Yizhang Lin and Bang Liu and Bangbang Liu and Binhao Wu and Danyang Li and Jiaqi Chen and Jiayi Zhang and Jinlin Wang and Li Zhang and Lingyao Zhang and Min Yang and Mingchen Zhuge and Taicheng Guo and Tuo Zhou and Wei Tao and Wenyi Wang and Xiangru Tang and Xiangtao Lu and Xiawu Zheng and Xinbing Liang and Yaying Fei and Yuheng Cheng and Zongze Xu and Chenglin Wu},
year={2024},
eprint={2402.18679},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
```
10 changes: 9 additions & 1 deletion docs/README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Hugging Face Space で試す

## 引用

現時点では、[arXiv 論文](https://arxiv.org/abs/2308.00352)を引用してください:
研究論文でMetaGPTやData Interpreterを使用する場合は、以下のように当社の作業を引用してください:

```bibtex
@misc{hong2023metagpt,
Expand All @@ -306,6 +306,14 @@ Hugging Face Space で試す
archivePrefix={arXiv},
primaryClass={cs.AI}
}
@misc{hong2024data,
title={Data Interpreter: An LLM Agent For Data Science},
author={Sirui Hong and Yizhang Lin and Bang Liu and Bangbang Liu and Binhao Wu and Danyang Li and Jiaqi Chen and Jiayi Zhang and Jinlin Wang and Li Zhang and Lingyao Zhang and Min Yang and Mingchen Zhuge and Taicheng Guo and Tuo Zhou and Wei Tao and Wenyi Wang and Xiangru Tang and Xiangtao Lu and Xiawu Zheng and Xinbing Liang and Yaying Fei and Yuheng Cheng and Zongze Xu and Chenglin Wu},
year={2024},
eprint={2402.18679},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
```

## お問い合わせ先
Expand Down
2 changes: 2 additions & 0 deletions examples/android_assistant/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyshine==0.0.9
opencv-python==4.6.0.66
Loading

0 comments on commit bf77d2a

Please sign in to comment.