Spaces:
Runtime error
Runtime error
shenchucheng commited on
Commit ·
faf9dc6
1
Parent(s): 4e8e742
create meatgpt webui
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .agent-store-config.yaml+1-1
- .agent-store-config.yaml.exampleDeleted-9
- .dockerignore+1
- Dockerfile+8-10
- README.md+1-260
- metagpt/web/app.py → app.pyRenamed+56-10
- config/config.yaml+58-22
- docs/FAQ-EN.mdDeleted-181
- docs/README_CN.mdDeleted-201
- docs/README_JA.mdDeleted-210
- docs/ROADMAP.mdDeleted-84
- docs/resources/20230811-214014.jpgDeleted
- docs/resources/MetaGPT-WeChat-Personal.jpegDeleted
- docs/resources/MetaGPT-WorkWeChatGroup-6.jpgDeleted
- docs/resources/MetaGPT-logo.jpegDeleted
- docs/resources/MetaGPT-logo.pngDeleted
- docs/resources/software_company_cd.jpegDeleted
- docs/resources/software_company_sd.jpegDeleted
- docs/resources/workspace/content_rec_sys/resources/competitive_analysis.pdfDeleted
- docs/resources/workspace/content_rec_sys/resources/competitive_analysis.pngDeleted
- docs/resources/workspace/content_rec_sys/resources/competitive_analysis.svgDeleted
- docs/resources/workspace/content_rec_sys/resources/data_api_design.pdfDeleted
- docs/resources/workspace/content_rec_sys/resources/data_api_design.pngDeleted
- docs/resources/workspace/content_rec_sys/resources/data_api_design.svgDeleted
- docs/resources/workspace/content_rec_sys/resources/seq_flow.pdfDeleted
- docs/resources/workspace/content_rec_sys/resources/seq_flow.pngDeleted
- docs/resources/workspace/content_rec_sys/resources/seq_flow.svgDeleted
- docs/resources/workspace/llmops_framework/resources/competitive_analysis.pdfDeleted
- docs/resources/workspace/llmops_framework/resources/competitive_analysis.pngDeleted
- docs/resources/workspace/llmops_framework/resources/competitive_analysis.svgDeleted
- docs/resources/workspace/llmops_framework/resources/data_api_design.pdfDeleted
- docs/resources/workspace/llmops_framework/resources/data_api_design.pngDeleted
- docs/resources/workspace/llmops_framework/resources/data_api_design.svgDeleted
- docs/resources/workspace/llmops_framework/resources/seq_flow.pdfDeleted
- docs/resources/workspace/llmops_framework/resources/seq_flow.pngDeleted
- docs/resources/workspace/llmops_framework/resources/seq_flow.svgDeleted
- docs/resources/workspace/match3_puzzle_game/resources/competitive_analysis.pdfDeleted
- docs/resources/workspace/match3_puzzle_game/resources/competitive_analysis.pngDeleted
- docs/resources/workspace/match3_puzzle_game/resources/competitive_analysis.svgDeleted
- docs/resources/workspace/match3_puzzle_game/resources/data_api_design.pdfDeleted
- docs/resources/workspace/match3_puzzle_game/resources/data_api_design.pngDeleted
- docs/resources/workspace/match3_puzzle_game/resources/data_api_design.svgDeleted
- docs/resources/workspace/match3_puzzle_game/resources/seq_flow.pdfDeleted
- docs/resources/workspace/match3_puzzle_game/resources/seq_flow.pngDeleted
- docs/resources/workspace/match3_puzzle_game/resources/seq_flow.svgDeleted
- docs/resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.pdfDeleted
- docs/resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.pngDeleted
- docs/resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.svgDeleted
- docs/resources/workspace/minimalist_pomodoro_timer/resources/data_api_design.pdfDeleted
- docs/resources/workspace/minimalist_pomodoro_timer/resources/data_api_design.pngDeleted
123456role:name: SoftwareCompanymodule: metagpt.roles.software_companyskills:- name: WritePRD- name: WriteDesign123456role:name: SoftwareCompanymodule: software_companyskills:- name: WritePRD- name: WriteDesign
123456789role: name: Teacher # Referenced the `Teacher` in `metagpt/roles/teacher.py`. module: metagpt.roles.teacher # Referenced `metagpt/roles/teacher.py`. skills: # Refer to the skill `name` of the published skill in `.well-known/skills.yaml`. - name: text_to_speech description: Text-to-speech - name: text_to_image description: Create a drawing based on the text.
4 unmodified lines5674 unmodified linesdistdatageckodriver.log4 unmodified lines56784 unmodified linesdistdatageckodriver.loglogs
3 unmodified lines456789101 unmodified line12131415161718192021222324252627282930313 unmodified linesUSER root# Install Debian software needed by MetaGPT and clean up in one RUN command to reduce image sizeRUN apt update &&\apt install -y git chromium fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends &&\apt clean && rm -rf /var/lib/apt/lists/*1 unmodified lineENV CHROME_BIN="/usr/bin/chromium" \PUPPETEER_CONFIG="/app/metagpt/config/puppeteer-config.json"\PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"RUN npm install -g @mermaid-js/mermaid-cli &&\npm cache clean --force# Install Python dependencies and install MetaGPTCOPY requirements.txt requirements.txtRUN pip install --no-cache-dir -r requirements.txtCOPY . /app/metagptWORKDIR /app/metagptRUN chmod -R 777 /app/metagpt/logs/ &&\mkdir workspace &&\chmod -R 777 /app/metagpt/workspace/ &&\python -m pip install -e.CMD ["python", "metagpt/web/app.py"]3 unmodified lines45678910111 unmodified line13141516171819202122232425262728293 unmodified linesUSER root# Install Debian software needed by MetaGPT and clean up in one RUN command to reduce image sizeRUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \apt update &&\apt install -y git chromium fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends &&\apt clean && rm -rf /var/lib/apt/lists/*1 unmodified lineENV CHROME_BIN="/usr/bin/chromium" \PUPPETEER_CONFIG="/app/metagpt/config/puppeteer-config.json"\PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"RUN npm install -g @mermaid-js/mermaid-cli --registry=http://registry.npmmirror.com &&\npm cache clean --force# Install Python dependencies and install MetaGPTCOPY requirements.txt requirements.txtRUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simpleWORKDIR /appCOPY . .CMD ["uvicorn", "app:app"]
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260---title: MetaGPTemoji: 🐼colorFrom: greencolorTo: bluesdk: dockerapp_file: app.pypinned: false---# MetaGPT: The Multi-Agent Framework<p align="center"><a href=""><img src="docs/resources/MetaGPT-logo.jpeg" alt="MetaGPT logo: Enable GPT to work in software company, collaborating to tackle more complex tasks." width="150px"></a></p><p align="center"><b>Assign different roles to GPTs to form a collaborative software entity for complex tasks.</b></p><p align="center"><a href="docs/README_CN.md"><img src="https://img.shields.io/badge/文档-中文版-blue.svg" alt="CN doc"></a><a href="README.md"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a><a href="docs/README_JA.md"><img src="https://img.shields.io/badge/ドキュメント-日本語-blue.svg" alt="JA doc"></a><a href="https://discord.gg/wCp6Q3fsAk"><img src="https://dcbadge.vercel.app/api/server/wCp6Q3fsAk?compact=true&style=flat" alt="Discord Follow"></a><a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a><a href="docs/ROADMAP.md"><img src="https://img.shields.io/badge/ROADMAP-路线图-blue" alt="roadmap"></a><a href="docs/resources/MetaGPT-WeChat-Personal.jpeg"><img src="https://img.shields.io/badge/WeChat-微信-blue" alt="roadmap"></a><a href="https://twitter.com/DeepWisdom2019"><img src="https://img.shields.io/twitter/follow/MetaGPT?style=social" alt="Twitter Follow"></a></p><p align="center"><a href="https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/geekan/MetaGPT"><img src="https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode" alt="Open in Dev Containers"></a><a href="https://codespaces.new/geekan/MetaGPT"><img src="https://img.shields.io/badge/Github_Codespace-Open-blue?logo=github" alt="Open in GitHub Codespaces"></a></p>1. MetaGPT takes a **one line requirement** as input and outputs **user stories / competitive analysis / requirements / data structures / APIs / documents, etc.**2. Internally, MetaGPT includes **product managers / architects / project managers / engineers.** It provides the entire process of a **software company along with carefully orchestrated SOPs.**1. `Code = SOP(Team)` is the core philosophy. We materialize SOP and apply it to teams composed of LLMs.<p align="center">Software Company Multi-Role Schematic (Gradually Implementing)</p>## Examples (fully generated by GPT-4)For example, if you type `python startup.py "Design a RecSys like Toutiao"`, you would get many outputs, one of them is data & api designIt costs approximately **$0.2** (in GPT-4 API fees) to generate one example with analysis and design, and around **$2.0** for a full project.## Installation### Installation Video Guide- [Matthew Berman: How To Install MetaGPT - Build A Startup With One Prompt!!](https://youtu.be/uT75J_KG_aY)### Traditional Installation```bash# Step 1: Ensure that NPM is installed on your system. Then install mermaid-js.npm --versionsudo npm install -g @mermaid-js/mermaid-cli# Step 2: Ensure that Python 3.9+ is installed on your system. You can check this by using:python --version# Step 3: Clone the repository to your local machine, and install it.git clone https://github.com/geekan/metagptcd metagptpython setup.py install```**Note:**- If already have Chrome, Chromium, or MS Edge installed, you can skip downloading Chromium by setting the environment variable`PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` to `true`.- Some people are [having issues](https://github.com/mermaidjs/mermaid.cli/issues/15) installing this tool globally. Installing it locally is an alternative solution,```bashnpm install @mermaid-js/mermaid-cli```- don't forget to the configuration for mmdc in config.yml```ymlPUPPETEER_CONFIG: "./config/puppeteer-config.json"MMDC: "./node_modules/.bin/mmdc"```- if `python setup.py install` fails with error `[Errno 13] Permission denied: '/usr/local/lib/python3.11/dist-packages/test-easy-install-13129.write-test'`, try instead running `python setup.py install --user`### Installation by Docker```bash# Step 1: Download metagpt official image and prepare config.yamldocker pull metagpt/metagpt:v0.3.1mkdir -p /opt/metagpt/{config,workspace}docker run --rm metagpt/metagpt:v0.3.1 cat /app/metagpt/config/config.yaml > /opt/metagpt/config/key.yamlvim /opt/metagpt/config/key.yaml # Change the config# Step 2: Run metagpt demo with containerdocker run --rm \--privileged \-v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \-v /opt/metagpt/workspace:/app/metagpt/workspace \metagpt/metagpt:v0.3.1 \python startup.py "Write a cli snake game"# You can also start a container and execute commands in itdocker run --name metagpt -d \--privileged \-v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \-v /opt/metagpt/workspace:/app/metagpt/workspace \metagpt/metagpt:v0.3.1docker exec -it metagpt /bin/bash$ python startup.py "Write a cli snake game"```The command `docker run ...` do the following things:- Run in privileged mode to have permission to run the browser- Map host directory `/opt/metagpt/config` to container directory `/app/metagpt/config`- Map host directory `/opt/metagpt/workspace` to container directory `/app/metagpt/workspace`- Execute the demo command `python startup.py "Write a cli snake game"`### Build image by yourself```bash# You can also build metagpt image by yourself.git clone https://github.com/geekan/MetaGPT.gitcd MetaGPT && docker build -t metagpt:custom .```## Configuration- Configure your `OPENAI_API_KEY` in any of `config/key.yaml / config/config.yaml / env`- Priority order: `config/key.yaml > config/config.yaml > env````bash# Copy the configuration file and make the necessary modifications.cp config/config.yaml config/key.yaml```| Variable Name | config/key.yaml | env || ------------------------------------------ | ----------------------------------------- | ----------------------------------------------- || OPENAI_API_KEY # Replace with your own key | OPENAI_API_KEY: "sk-..." | export OPENAI_API_KEY="sk-..." || OPENAI_API_BASE # Optional | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |## Tutorial: Initiating a startup```shell# Run the scriptpython startup.py "Write a cli snake game"# Do not hire an engineer to implement the projectpython startup.py "Write a cli snake game" --implement False# Hire an engineer and perform code reviewspython startup.py "Write a cli snake game" --code_review True```After running the script, you can find your new project in the `workspace/` directory.### Preference of Platform or ToolYou can tell which platform or tool you want to use when stating your requirements.```shellpython startup.py "Write a cli snake game based on pygame"```### Usage```NAMEstartup.py - We are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities.SYNOPSISstartup.py IDEA <flags>DESCRIPTIONWe are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities.POSITIONAL ARGUMENTSIDEAType: strYour innovative idea, such as "Creating a snake game."FLAGS--investment=INVESTMENTType: floatDefault: 3.0As an investor, you have the opportunity to contribute a certain dollar amount to this AI company.--n_round=N_ROUNDType: intDefault: 5NOTESYou can also use flags syntax for POSITIONAL ARGUMENTS```### Code walkthrough```pythonfrom metagpt.software_company import SoftwareCompanyfrom metagpt.roles import ProjectManager, ProductManager, Architect, Engineerasync def startup(idea: str, investment: float = 3.0, n_round: int = 5):"""Run a startup. Be a boss."""company = SoftwareCompany()company.hire([ProductManager(), Architect(), ProjectManager(), Engineer()])company.invest(investment)company.start_project(idea)await company.run(n_round=n_round)```You can check `examples` for more details on single role (with knowledge base) and LLM only examples.## QuickStartIt is difficult to install and configure the local environment for some users. The following tutorials will allow you to quickly experience the charm of MetaGPT.- [MetaGPT quickstart](https://deepwisdom.feishu.cn/wiki/CyY9wdJc4iNqArku3Lncl4v8n2b)## CitationFor now, cite the [Arxiv paper](https://arxiv.org/abs/2308.00352):```bibtex@misc{hong2023metagpt,title={MetaGPT: Meta Programming for Multi-Agent Collaborative Framework},author={Sirui Hong and Xiawu Zheng and Jonathan Chen and Yuheng Cheng and Jinlin Wang and Ceyao Zhang and Zili Wang and Steven Ka Shing Yau and Zijuan Lin and Liyang Zhou and Chenyu Ran and Lingfeng Xiao and Chenglin Wu},year={2023},eprint={2308.00352},archivePrefix={arXiv},primaryClass={cs.AI}}```## Contact InformationIf you have any questions or feedback about this project, please feel free to contact us. We highly appreciate your suggestions!- **Email:** alexanderwu@fuzhi.ai- **GitHub Issues:** For more technical inquiries, you can also create a new issue in our [GitHub repository](https://github.com/geekan/metagpt/issues).We will respond to all questions within 2-3 business days.## Demohttps://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d## Join us📢 Join Our Discord Channel!https://discord.gg/ZRHeExS6xvLooking forward to seeing you there! 🎉1# MetaGPT Web UI
123456789104 unmodified lines15161718192021222324252670 unmodified lines97989910010110210310410510610710810937 unmodified lines14714814915015115215317 unmodified lines1711721731741751761771781791801811821831841851867 unmodified lines19419519619719819920015 unmodified lines216217218219220221#!/usr/bin/python3# -*- coding: utf-8 -*-import asyncioimport urllib.parsefrom datetime import datetimeimport uuidfrom enum import Enumfrom fastapi import FastAPI, Request, HTTPExceptionfrom fastapi.responses import StreamingResponse, RedirectResponse4 unmodified linesfrom typing import Any, Optionalfrom metagpt import Messagefrom metagpt.actions.action import Actionfrom metagpt.actions.action_output import ActionOutputfrom metagpt.config import CONFIGfrom metagpt.roles.software_company import RoleRun, SoftwareCompanyclass QueryAnswerType(Enum):70 unmodified linesdescription=action.desc,)def update_act(self, message: ActionOutput):self.step.status = "finish"self.step.content = Sentence(type="text",id=ThinkActPrompt.guid32(),value=SentenceValue(answer=message.content),is_finished=True,)@staticmethod37 unmodified linesSession message stream"""config = {k.upper(): v for k, v in req_model.config.items()}CONFIG.set_context(config)role = SoftwareCompany()role.recv(message=Message(content=req_model.query))answer = MessageJsonModel(17 unmodified linesthink_result: RoleRun = await role.think()if not think_result: # End of conversionbreakthink_act_prompt = ThinkActPrompt(role=think_result.role.profile)think_act_prompt.update_think(tc_id, think_result)yield think_act_prompt.prompt + "\n\n"act_result = await role.act()think_act_prompt.update_act(act_result)yield think_act_prompt.prompt + "\n\n"answer.add_think_act(think_act_prompt)yield answer.prompt + "\n\n" # Notify the front-end that the message is complete.class ChatHandler:@staticmethodasync def create_message(req_model: NewMsg, request: Request):7 unmodified linesapp.mount("/static",StaticFiles(directory="./metagpt/static/", check_dir=True),name="static",)app.add_api_route(15 unmodified linesreturn RedirectResponse(url=new_path)def main():uvicorn.run(app="__main__:app", host="0.0.0.0", port=7860)12345678910111213141516174 unmodified lines22232425262728293031323370 unmodified lines10410510610710810911011111211311411511611737 unmodified lines15515615715815916016116216316416517 unmodified lines1831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282297 unmodified lines23723823924024124224315 unmodified lines259260261262263264265266267#!/usr/bin/python3# -*- coding: utf-8 -*-from __future__ import annotationsimport asynciofrom collections import dequeimport contextlibfrom functools import partialimport urllib.parsefrom datetime import datetimeimport uuidfrom enum import Enumfrom metagpt.logs import set_llm_stream_logfuncimport pathlibfrom fastapi import FastAPI, Request, HTTPExceptionfrom fastapi.responses import StreamingResponse, RedirectResponse4 unmodified linesfrom typing import Any, Optionalfrom metagpt.schema import Messagefrom metagpt.actions.action import Actionfrom metagpt.actions.action_output import ActionOutputfrom metagpt.config import CONFIGfrom software_company import RoleRun, SoftwareCompanyclass QueryAnswerType(Enum):70 unmodified linesdescription=action.desc,)def update_act(self, message: ActionOutput | str, is_finished: bool = True):if is_finished:self.step.status = "finish"self.step.content = Sentence(type="text",id=str(1),value=SentenceValue(answer=message.content if is_finished else message),is_finished=is_finished,)@staticmethod37 unmodified linesSession message stream"""config = {k.upper(): v for k, v in req_model.config.items()}set_context(config, uuid.uuid4().hex)msg_queue = deque()CONFIG.LLM_STREAM_LOG = lambda x: msg_queue.appendleft(x) if x else Nonerole = SoftwareCompany()role.recv(message=Message(content=req_model.query))answer = MessageJsonModel(17 unmodified linesthink_result: RoleRun = await role.think()if not think_result: # End of conversionbreakthink_act_prompt = ThinkActPrompt(role=think_result.role.profile)think_act_prompt.update_think(tc_id, think_result)yield think_act_prompt.prompt + "\n\n"task = asyncio.create_task(role.act())while not await request.is_disconnected():if msg_queue:think_act_prompt.update_act(msg_queue.pop(), False)yield think_act_prompt.prompt + "\n\n"continueif task.done():breakawait asyncio.sleep(0.5)act_result = await taskthink_act_prompt.update_act(act_result)yield think_act_prompt.prompt + "\n\n"answer.add_think_act(think_act_prompt)yield answer.prompt + "\n\n" # Notify the front-end that the message is complete.default_llm_stream_log = partial(print, end="")def llm_stream_log(msg):with contextlib.suppress():CONFIG._get("LLM_STREAM_LOG", default_llm_stream_log)(msg)def set_context(context, uid):context["WORKSPACE_PATH"] = pathlib.Path("workspace", uid)for old, new in (("DEPLOYMENT_ID", "DEPLOYMENT_NAME"), ("OPENAI_API_BASE", "OPENAI_BASE_URL")):if old in context and new not in context:context[new] = context[old]CONFIG.set_context(context)return contextclass ChatHandler:@staticmethodasync def create_message(req_model: NewMsg, request: Request):7 unmodified linesapp.mount("/static",StaticFiles(directory="./static/", check_dir=True),name="static",)app.add_api_route(15 unmodified linesreturn RedirectResponse(url=new_path)set_llm_stream_logfunc(llm_stream_log)def main():uvicorn.run(app="__main__:app", host="0.0.0.0", port=7860)
12345678910111213141516171819202122232425262729 unmodified lines57585960616263648 unmodified lines7374757677787980818283848586# DO NOT MODIFY THIS FILE, create a new key.yaml, define OPENAI_API_KEY.# The configuration of key.yaml has a higher priority and will not enter git#### if OpenAI## The official OPENAI_API_BASE is https://api.openai.com/v1## If the official OPENAI_API_BASE is not available, we recommend using the [openai-forward](https://github.com/beidongjiedeguang/openai-forward).## Or, you can configure OPENAI_PROXY to access official OPENAI_API_BASE.OPENAI_API_BASE: "https://api.openai.com/v1"#OPENAI_PROXY: "http://127.0.0.1:8118"#OPENAI_API_KEY: "YOUR_API_KEY"OPENAI_API_MODEL: "gpt-4"MAX_TOKENS: 1500RPM: 10#### if Anthropic#Anthropic_API_KEY: "YOUR_API_KEY"#### if AZURE, check https://github.com/openai/openai-cookbook/blob/main/examples/azure/chat.ipynb#OPENAI_API_TYPE: "azure"#OPENAI_API_BASE: "YOUR_AZURE_ENDPOINT"#OPENAI_API_KEY: "YOUR_AZURE_API_KEY"#OPENAI_API_VERSION: "YOUR_AZURE_API_VERSION"#DEPLOYMENT_ID: "YOUR_DEPLOYMENT_ID"#### for Search29 unmodified lines#### for Stable Diffusion## Use SD service, based on https://github.com/AUTOMATIC1111/stable-diffusion-webuiSD_URL: "YOUR_SD_URL"SD_T2I_API: "/sdapi/v1/txt2img"#### for Execution#LONG_TERM_MEMORY: false8 unmodified lines# CALC_USAGE: false### for ResearchMODEL_FOR_RESEARCHER_SUMMARY: gpt-3.5-turboMODEL_FOR_RESEARCHER_REPORT: gpt-3.5-turbo-16k### Meta Models#METAGPT_TEXT_TO_IMAGE_MODEL: MODEL_URL### S3 configS3:access_key: "YOUR_S3_ACCESS_KEY"secret_key: "YOUR_S3_SECRET_KEY"endpoint_url: "YOUR_S3_ENDPOINT_URL"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555629 unmodified lines86878889909192938 unmodified lines102103104105106107108109110111112113114115116117118119120121122# DO NOT MODIFY THIS FILE, create a new key.yaml, define OPENAI_API_KEY.# The configuration of key.yaml has a higher priority and will not enter git#### Project Path Setting# WORKSPACE_PATH: "Path for placing output files"#### if OpenAI## The official OPENAI_BASE_URL is https://api.openai.com/v1## If the official OPENAI_BASE_URL is not available, we recommend using the [openai-forward](https://github.com/beidongjiedeguang/openai-forward).## Or, you can configure OPENAI_PROXY to access official OPENAI_BASE_URL.OPENAI_BASE_URL: "https://api.openai.com/v1"#OPENAI_PROXY: "http://127.0.0.1:8118"#OPENAI_API_KEY: "YOUR_API_KEY" # set the value to sk-xxx if you host the openai interface for open llm modelOPENAI_API_MODEL: "gpt-4-1106-preview"MAX_TOKENS: 4096RPM: 10#### if Spark#SPARK_APPID : "YOUR_APPID"#SPARK_API_SECRET : "YOUR_APISecret"#SPARK_API_KEY : "YOUR_APIKey"#DOMAIN : "generalv2"#SPARK_URL : "ws://spark-api.xf-yun.com/v2.1/chat"#### if Anthropic#ANTHROPIC_API_KEY: "YOUR_API_KEY"#### if AZURE, check https://github.com/openai/openai-cookbook/blob/main/examples/azure/chat.ipynb#OPENAI_API_TYPE: "azure"#OPENAI_BASE_URL: "YOUR_AZURE_ENDPOINT"#OPENAI_API_KEY: "YOUR_AZURE_API_KEY"#OPENAI_API_VERSION: "YOUR_AZURE_API_VERSION"#DEPLOYMENT_NAME: "YOUR_DEPLOYMENT_NAME"#### if zhipuai from `https://open.bigmodel.cn`. You can set here or export API_KEY="YOUR_API_KEY"# ZHIPUAI_API_KEY: "YOUR_API_KEY"#### if Google Gemini from `https://ai.google.dev/` and API_KEY from `https://makersuite.google.com/app/apikey`.#### You can set here or export GOOGLE_API_KEY="YOUR_API_KEY"# GEMINI_API_KEY: "YOUR_API_KEY"#### if use self-host open llm model with openai-compatible interface#OPEN_LLM_API_BASE: "http://127.0.0.1:8000/v1"#OPEN_LLM_API_MODEL: "llama2-13b"###### if use Fireworks api#FIREWORKS_API_KEY: "YOUR_API_KEY"#FIREWORKS_API_BASE: "https://api.fireworks.ai/inference/v1"#FIREWORKS_API_MODEL: "YOUR_LLM_MODEL" # example, accounts/fireworks/models/llama-v2-13b-chat#### if use self-host open llm model by ollama# OLLAMA_API_BASE: http://127.0.0.1:11434/api# OLLAMA_API_MODEL: llama2#### for Search29 unmodified lines#### for Stable Diffusion## Use SD service, based on https://github.com/AUTOMATIC1111/stable-diffusion-webui#SD_URL: "YOUR_SD_URL"#SD_T2I_API: "/sdapi/v1/txt2img"#### for Execution#LONG_TERM_MEMORY: false8 unmodified lines# CALC_USAGE: false### for Research# MODEL_FOR_RESEARCHER_SUMMARY: gpt-3.5-turbo# MODEL_FOR_RESEARCHER_REPORT: gpt-3.5-turbo-16k### choose the engine for mermaid conversion,# default is nodejs, you can change it to playwright,pyppeteer or ink# MERMAID_ENGINE: nodejs### browser path for pyppeteer engine, support Chrome, Chromium,MS Edge#PYPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable"### for repair non-openai LLM's output when parse json-text if PROMPT_FORMAT=json### due to non-openai LLM's output will not always follow the instruction, so here activate a post-process### repair operation on the content extracted from LLM's raw output. Warning, it improves the result but not fix all cases.# REPAIR_LLM_OUTPUT: false# PROMPT_FORMAT: json #json or markdownDISABLE_LLM_PROVIDER_CHECK: true
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181Our vision is to [extend human life](https://github.com/geekan/HowToLiveLonger) and [reduce working hours](https://github.com/geekan/MetaGPT/).
1. ### Convenient Link for Sharing this Document:
```- MetaGPT-Index/FAQ https://deepwisdom.feishu.cn/wiki/MsGnwQBjiif9c3koSJNcYaoSnu4```
2. ### Link
<!---->
1. Code:https://github.com/geekan/MetaGPT
1. Roadmap:https://github.com/geekan/MetaGPT/blob/main/docs/ROADMAP.md
1. EN
1. Demo Video: [MetaGPT: Multi-Agent AI Programming Framework](https://www.youtube.com/watch?v=8RNzxZBTW8M) 1. Tutorial: [MetaGPT: Deploy POWERFUL Autonomous Ai Agents BETTER Than SUPERAGI!](https://www.youtube.com/watch?v=q16Gi9pTG_M&t=659s)
1. CN
1. Demo Video: [MetaGPT:一行代码搭建你的虚拟公司_哔哩哔哩_bilibili](https://www.bilibili.com/video/BV1NP411C7GW/?spm_id_from=333.999.0.0&vd_source=735773c218b47da1b4bd1b98a33c5c77) 1. Tutorial: [一个提示词写游戏 Flappy bird, 比AutoGPT强10倍的MetaGPT,最接近AGI的AI项目](https://youtu.be/Bp95b8yIH5c) 1. Author's thoughts video(CN): [MetaGPT作者深度解析直播回放_哔哩哔哩_bilibili](https://www.bilibili.com/video/BV1Ru411V7XL/?spm_id_from=333.337.search-card.all.click)
<!---->
3. ### How to become a contributor?
<!---->
1. Choose a task from the Roadmap (or you can propose one). By submitting a PR, you can become a contributor and join the dev team.1. Current contributors come from backgrounds including: ByteDance AI Lab/DingDong/Didi/Xiaohongshu, Tencent/Baidu/MSRA/TikTok/BloomGPT Infra/Bilibili/CUHK/HKUST/CMU/UCB
<!---->
4. ### Chief Evangelist (Monthly Rotation)
MetaGPT Community - The position of Chief Evangelist rotates on a monthly basis. The primary responsibilities include:
1. Maintaining community FAQ documents, announcements, Github resources/READMEs.1. Responding to, answering, and distributing community questions within an average of 30 minutes, including on platforms like Github Issues, Discord and WeChat.1. Upholding a community atmosphere that is enthusiastic, genuine, and friendly.1. Encouraging everyone to become contributors and participate in projects that are closely related to achieving AGI (Artificial General Intelligence).1. (Optional) Organizing small-scale events, such as hackathons.
<!---->
5. ### FAQ
<!---->
1. Experience with the generated repo code:
1. https://github.com/geekan/MetaGPT/releases/tag/v0.1.0
1. Code truncation/ Parsing failure:
1. Check if it's due to exceeding length. Consider using the gpt-3.5-turbo-16k or other long token versions.
1. Success rate:
1. There hasn't been a quantitative analysis yet, but the success rate of code generated by GPT-4 is significantly higher than that of gpt-3.5-turbo.
1. Support for incremental, differential updates (if you wish to continue a half-done task):
1. Several prerequisite tasks are listed on the ROADMAP.
1. Can existing code be loaded?
1. It's not on the ROADMAP yet, but there are plans in place. It just requires some time.
1. Support for multiple programming languages and natural languages?
1. It's listed on ROADMAP.
1. Want to join the contributor team? How to proceed?
1. Merging a PR will get you into the contributor's team. The main ongoing tasks are all listed on the ROADMAP.
1. PRD stuck / unable to access/ connection interrupted
1. The official OPENAI_API_BASE address is `https://api.openai.com/v1` 1. 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``"` 1. 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. 1. 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``"`
1. Absolutely! How can I assist you today?
1. Did you use Chi or a similar service? These services are prone to errors, and it seems that the error rate is higher when consuming 3.5k-4k tokens in GPT-4
1. What does Max token mean?
1. It's a configuration for OpenAI's maximum response length. If the response exceeds the max token, it will be truncated.
1. How to change the investment amount?
1. You can view all commands by typing `python startup.py --help`
1. Which version of Python is more stable?
1. python3.9 / python3.10
1. Can't use GPT-4, getting the error "The model gpt-4 does not exist."
1. OpenAI's official requirement: You can use GPT-4 only after spending $1 on OpenAI. 1. Tip: Run some data with gpt-3.5-turbo (consume the free quota and $1), and then you should be able to use gpt-4.
1. Can games whose code has never been seen before be written?
1. Refer to the README. The recommendation system of Toutiao is one of the most complex systems in the world currently. Although it's not on GitHub, many discussions about it exist online. If it can visualize these, it suggests it can also summarize these discussions and convert them into code. The prompt would be something like "write a recommendation system similar to Toutiao". Note: this was approached in earlier versions of the software. The SOP of those versions was different; the current one adopts Elon Musk's five-step work method, emphasizing trimming down requirements as much as possible.
1. Under what circumstances would there typically be errors?
1. More than 500 lines of code: some function implementations may be left blank. 1. When using a database, it often gets the implementation wrong — since the SQL database initialization process is usually not in the code. 1. With more lines of code, there's a higher chance of false impressions, leading to calls to non-existent APIs.
1. Instructions for using SD Skills/UI Role:
1. Currently, there is a test script located in /tests/metagpt/roles. The file ui_role provides the corresponding code implementation. For testing, you can refer to the test_ui in the same directory.
1. The UI role takes over from the product manager role, extending the output from the 【UI Design draft】 provided by the product manager role. The UI role has implemented the UIDesign Action. Within the run of UIDesign, it processes the respective context, and based on the set template, outputs the UI. The output from the UI role includes:
1. UI Design Description:Describes the content to be designed and the design objectives. 1. Selected Elements:Describes the elements in the design that need to be illustrated. 1. HTML Layout:Outputs the HTML code for the page. 1. CSS Styles (styles.css):Outputs the CSS code for the page.
1. Currently, the SD skill is a tool invoked by UIDesign. It instantiates the SDEngine, with specific code found in metagpt/tools/sd_engine.
1. Configuration instructions for SD Skills: The SD interface is currently deployed based on *https://github.com/AUTOMATIC1111/stable-diffusion-webui* **For environmental configurations and model downloads, please refer to the aforementioned GitHub repository. To initiate the SD service that supports API calls, run the command specified in cmd with the parameter nowebui, i.e.,
1. > python webui.py --enable-insecure-extension-access --port xxx --no-gradio-queue --nowebui 1. Once it runs without errors, the interface will be accessible after approximately 1 minute when the model finishes loading. 1. Configure SD_URL and SD_T2I_API in the config.yaml/key.yaml files. 1.  1. SD_URL is the deployed server/machine IP, and Port is the specified port above, defaulting to 7860. 1. > SD_URL: IP:Port
1. An error occurred during installation: "Another program is using this file...egg".
1. Delete the file and try again. 1. Or manually execute`pip install -r requirements.txt`
1. The origin of the name MetaGPT?
1. The name was derived after iterating with GPT-4 over a dozen rounds. GPT-4 scored and suggested it.
1. Is there a more step-by-step installation tutorial?
1. Youtube(CN):[一个提示词写游戏 Flappy bird, 比AutoGPT强10倍的MetaGPT,最接近AGI的AI项目=一个软件公司产品经理+程序员](https://youtu.be/Bp95b8yIH5c) 1. Youtube(EN)https://www.youtube.com/watch?v=q16Gi9pTG_M&t=659s
1. openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details
1. If you haven't exhausted your free quota, set RPM to 3 or lower in the settings. 1. If your free quota is used up, consider adding funds to your account.
1. What does "borg" mean in n_borg?
1. https://en.wikipedia.org/wiki/Borg 1. The Borg civilization operates based on a hive or collective mentality, known as "the Collective." Every Borg individual is connected to the collective via a sophisticated subspace network, ensuring continuous oversight and guidance for every member. This collective consciousness allows them to not only "share the same thoughts" but also to adapt swiftly to new strategies. While individual members of the collective rarely communicate, the collective "voice" sometimes transmits aboard ships.
1. How to use the Claude API?
1. The full implementation of the Claude API is not provided in the current code. 1. You can use the Claude API through third-party API conversion projects like: https://github.com/jtsang4/claude-to-chatgpt
1. Is Llama2 supported?
1. On the day Llama2 was released, some of the community members began experiments and found that output can be generated based on MetaGPT's structure. However, Llama2's context is too short to generate a complete project. Before regularly using Llama2, it's necessary to expand the context window to at least 8k. If anyone has good recommendations for expansion models or methods, please leave a comment.
1. `mermaid-cli getElementsByTagName SyntaxError: Unexpected token '.'`
1. Upgrade node to version 14.x or above:
1. `npm install -g n` 1. `n stable` to install the stable version of node(v18.x)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201# MetaGPT: 多智能体框架
<p align="center"><a href=""><img src="resources/MetaGPT-logo.jpeg" alt="MetaGPT logo: 使 GPT 以软件公司的形式工作,协作处理更复杂的任务" width="150px"></a></p>
<p align="center"><b>使 GPTs 组成软件公司,协作处理更复杂的任务</b></p>
<p align="center"><a href="README_CN.md"><img src="https://img.shields.io/badge/文档-中文版-blue.svg" alt="CN doc"></a><a href="../README.md"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a><a href="README_JA.md"><img src="https://img.shields.io/badge/ドキュメント-日本語-blue.svg" alt="JA doc"></a><a href="https://discord.gg/wCp6Q3fsAk"><img src="https://dcbadge.vercel.app/api/server/wCp6Q3fsAk?compact=true&style=flat" alt="Discord Follow"></a><a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a><a href="ROADMAP.md"><img src="https://img.shields.io/badge/ROADMAP-路线图-blue" alt="roadmap"></a><a href="resources/MetaGPT-WeChat-Personal.jpeg"><img src="https://img.shields.io/badge/WeChat-微信-blue" alt="roadmap"></a><a href="https://twitter.com/DeepWisdom2019"><img src="https://img.shields.io/twitter/follow/MetaGPT?style=social" alt="Twitter Follow"></a></p>
1. MetaGPT输入**一句话的老板需求**,输出**用户故事 / 竞品分析 / 需求 / 数据结构 / APIs / 文件等**2. MetaGPT内部包括**产品经理 / 架构师 / 项目经理 / 工程师**,它提供了一个**软件公司**的全过程与精心调配的SOP 1. `Code = SOP(Team)` 是核心哲学。我们将SOP具象化,并且用于LLM构成的团队

<p align="center">软件公司多角色示意图(正在逐步实现)</p>
## 示例(均由 GPT-4 生成)
例如,键入`python startup.py "写个类似今日头条的推荐系统"`并回车,你会获得一系列输出,其一是数据结构与API设计

这需要大约**0.2美元**(GPT-4 API的费用)来生成一个带有分析和设计的示例,大约2.0美元用于一个完整的项目
## 安装
### 传统安装
```bash# 第 1 步:确保您的系统上安装了 NPM。并使用npm安装mermaid-jsnpm --versionsudo npm install -g @mermaid-js/mermaid-cli
# 第 2 步:确保您的系统上安装了 Python 3.9+。您可以使用以下命令进行检查:python --version
# 第 3 步:克隆仓库到您的本地机器,并进行安装。git clone https://github.com/geekan/metagptcd metagptpython setup.py install```
### Docker安装
```bash# 步骤1: 下载metagpt官方镜像并准备好config.yamldocker pull metagpt/metagpt:v0.3mkdir -p /opt/metagpt/{config,workspace}docker run --rm metagpt/metagpt:v0.3 cat /app/metagpt/config/config.yaml > /opt/metagpt/config/config.yamlvim /opt/metagpt/config/config.yaml # 修改config
# 步骤2: 使用容器运行metagpt演示docker run --rm \ --privileged \ -v /opt/metagpt/config:/app/metagpt/config \ -v /opt/metagpt/workspace:/app/metagpt/workspace \ metagpt/metagpt:v0.3 \ python startup.py "Write a cli snake game"
# 您也可以启动一个容器并在其中执行命令docker run --name metagpt -d \ --privileged \ -v /opt/metagpt/config:/app/metagpt/config \ -v /opt/metagpt/workspace:/app/metagpt/workspace \ metagpt/metagpt:v0.3
docker exec -it metagpt /bin/bash$ python startup.py "Write a cli snake game"```
`docker run ...`做了以下事情:
- 以特权模式运行,有权限运行浏览器- 将主机目录 `/opt/metagpt/config` 映射到容器目录`/app/metagpt/config`- 将主机目录 `/opt/metagpt/workspace` 映射到容器目录 `/app/metagpt/workspace`- 执行演示命令 `python startup.py "Write a cli snake game"`
### 自己构建镜像
```bash# 您也可以自己构建metagpt镜像git clone https://github.com/geekan/MetaGPT.gitcd MetaGPT && docker build -t metagpt:v0.3 .```
## 配置
- 在 `config/key.yaml / config/config.yaml / env` 中配置您的 `OPENAI_API_KEY`- 优先级顺序:`config/key.yaml > config/config.yaml > env`
```bash# 复制配置文件并进行必要的修改cp config/config.yaml config/key.yaml```
| 变量名 | config/key.yaml | env ||--------------------------------------------|-------------------------------------------|--------------------------------|| OPENAI_API_KEY # 用您自己的密钥替换 | OPENAI_API_KEY: "sk-..." | export OPENAI_API_KEY="sk-..." || OPENAI_API_BASE # 可选 | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |
## 示例:启动一个创业公司
```shellpython startup.py "��一个命令行贪吃蛇"# 开启code review模式会会花费更多的money, 但是会提升代码质量和成功率python startup.py "写一个命令行贪吃蛇" --code_review True```
运行脚本后,您可以在 `workspace/` 目录中找到您的新项目。### 平台或工具的倾向性可以在阐述需求时说明想要使用的平台或工具。例如:
```shellpython startup.py "写一个基于pygame的命令行贪吃蛇"```
### 使用
```名称 startup.py - 我们是一家AI软件创业公司。通过投资我们,您将赋能一个充满无限可能的未来。
概要 startup.py IDEA <flags>
描述 我们是一家AI软件创业公司。通过投资我们,您将赋能一个充满无限可能的未来。
位置参数 IDEA 类型: str 您的创新想法,例如"写一个命令行贪吃蛇。"
标志 --investment=INVESTMENT 类型: float 默认值: 3.0 作为投资者,您有机会向这家AI公司投入一定的美元金额。 --n_round=N_ROUND 类型: int 默认值: 5
备注 您也可以用`标志`的语法,来处理`位置参数````
### 代码实现
```pythonfrom metagpt.software_company import SoftwareCompanyfrom metagpt.roles import ProjectManager, ProductManager, Architect, Engineer
async def startup(idea: str, investment: float = 3.0, n_round: int = 5): """运行一个创业公司。做一个老板""" company = SoftwareCompany() company.hire([ProductManager(), Architect(), ProjectManager(), Engineer()]) company.invest(investment) company.start_project(idea) await company.run(n_round=n_round)```
你可以查看`examples`,其中有单角色(带知识库)的使用例子与仅LLM的使用例子。
## 快速体验对一些用户来说,安装配置本地环境是有困难的,下面这些教程能够让你快速体验到MetaGPT的魅力。
- [MetaGPT快速体验](https://deepwisdom.feishu.cn/wiki/Q8ycw6J9tiNXdHk66MRcIN8Pnlg)
## 联系信息
如果您对这个项目有任何问题或反馈,欢迎联系我们。我们非常欢迎您的建议!
- **邮箱:** alexanderwu@fuzhi.ai- **GitHub 问题:** 对于更技术性的问题,您也可以在我们的 [GitHub 仓库](https://github.com/geekan/metagpt/issues) 中创建一个新的问题。
我们会在2-3个工作日内回复所有问题。
## 演示
https://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d
## 加入我们
📢 加入我们的Discord频道!https://discord.gg/ZRHeExS6xv
期待在那里与您相见!🎉123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210# MetaGPT: マルチエージェントフレームワーク
<p align="center"><a href=""><img src="resources/MetaGPT-logo.jpeg" alt="MetaGPT ロゴ: GPT がソフトウェア会社で働けるようにし、協力してより複雑な仕事に取り組む。" width="150px"></a></p>
<p align="center"><b>GPT にさまざまな役割を割り当てることで、複雑なタスクのための共同ソフトウェアエンティティを形成します。</b></p>
<p align="center"><a href="README_CN.md"><img src="https://img.shields.io/badge/文档-中文版-blue.svg" alt="CN doc"></a><a href="../README.md"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a><a href="README_JA.md"><img src="https://img.shields.io/badge/ドキュメント-日本語-blue.svg" alt="JA doc"></a><a href="https://discord.gg/wCp6Q3fsAk"><img src="https://dcbadge.vercel.app/api/server/wCp6Q3fsAk?compact=true&style=flat" alt="Discord Follow"></a><a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a><a href="docs/ROADMAP.md"><img src="https://img.shields.io/badge/ROADMAP-路线图-blue" alt="roadmap"></a><a href="resources/MetaGPT-WeChat-Personal.jpeg"><img src="https://img.shields.io/badge/WeChat-微信-blue" alt="roadmap"></a><a href="https://twitter.com/DeepWisdom2019"><img src="https://img.shields.io/twitter/follow/MetaGPT?style=social" alt="Twitter Follow"></a></p>
1. MetaGPT は、**1 行の要件** を入力とし、**ユーザーストーリー / 競合分析 / 要件 / データ構造 / API / 文書など** を出力します。2. MetaGPT には、**プロダクト マネージャー、アーキテクト、プロジェクト マネージャー、エンジニア** が含まれています。MetaGPT は、**ソフトウェア会社のプロセス全体を、慎重に調整された SOP とともに提供します。** 1. `Code = SOP(Team)` が基本理念です。私たちは SOP を具体化し、LLM で構成されるチームに適用します。

<p align="center">ソフトウェア会社のマルチロール図式(順次導入)</p>
## 例(GPT-4 で完全生成)
例えば、`python startup.py "Toutiao のような RecSys をデザインする"`と入力すると、多くの出力が得られます

解析と設計を含む 1 つの例を生成するのに、**$0.2** (GPT-4 の api のコスト)程度、完全なプロジェクトには **$2.0** 程度が必要です。
## インストール
### 伝統的なインストール
```bash# ステップ 1: NPM がシステムにインストールされていることを確認してください。次に mermaid-js をインストールします。npm --versionsudo npm install -g @mermaid-js/mermaid-cli
# ステップ 2: Python 3.9+ がシステムにインストールされていることを確認してください。これを確認するには:python --version
# ステップ 3: リポジトリをローカルマシンにクローンし、インストールする。git clone https://github.com/geekan/metagptcd metagptpython setup.py install```
**注:**
- すでに Chrome、Chromium、MS Edge がインストールされている場合は、環境変数 `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` を `true` に設定することで、Chromium のダウンロードをスキップすることができます。
- このツールをグローバルにインストールする[問題を抱えている](https://github.com/mermaidjs/mermaid.cli/issues/15)人もいます。ローカルにインストールするのが代替の解決策です、
```bash npm install @mermaid-js/mermaid-cli ```
- config.yml に mmdc のコンフィギュレーションを記述するのを忘れないこと
```yml PUPPETEER_CONFIG: "./config/puppeteer-config.json" MMDC: "./node_modules/.bin/mmdc" ```
### Docker によるインストール
```bash# ステップ 1: metagpt 公式イメージをダウンロードし、config.yaml を準備するdocker pull metagpt/metagpt:v0.3.1mkdir -p /opt/metagpt/{config,workspace}docker run --rm metagpt/metagpt:v0.3.1 cat /app/metagpt/config/config.yaml > /opt/metagpt/config/key.yamlvim /opt/metagpt/config/key.yaml # 設定を変更する
# ステップ 2: コンテナで metagpt デモを実行するdocker run --rm \ --privileged \ -v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \ -v /opt/metagpt/workspace:/app/metagpt/workspace \ metagpt/metagpt:v0.3.1 \ python startup.py "Write a cli snake game"
# コンテナを起動し、その中でコマンドを実行することもできますdocker run --name metagpt -d \ --privileged \ -v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \ -v /opt/metagpt/workspace:/app/metagpt/workspace \ metagpt/metagpt:v0.3.1
docker exec -it metagpt /bin/bash$ python startup.py "Write a cli snake game"```
コマンド `docker run ...` は以下のことを行います:
- 特権モードで実行し、ブラウザの実行権限を得る- ホストディレクトリ `/opt/metagpt/config` をコンテナディレクトリ `/app/metagpt/config` にマップする- ホストディレクトリ `/opt/metagpt/workspace` をコンテナディレクトリ `/app/metagpt/workspace` にマップする- デモコマンド `python startup.py "Write a cli snake game"` を実行する
### 自分でイメージをビルドする
```bash# また、自分で metagpt イメージを構築することもできます。git clone https://github.com/geekan/MetaGPT.gitcd MetaGPT && docker build -t metagpt:custom .```
## 設定
- `OPENAI_API_KEY` を `config/key.yaml / config/config.yaml / env` のいずれかで設定します。- 優先順位は: `config/key.yaml > config/config.yaml > env` の順です。
```bash# 設定ファイルをコピーし、必要な修正を加える。cp config/config.yaml config/key.yaml```
| 変数名 | config/key.yaml | env || ------------------------------------------ | ----------------------------------------- | ----------------------------------------------- || OPENAI_API_KEY # 自分のキーに置き換える | OPENAI_API_KEY: "sk-..." | export OPENAI_API_KEY="sk-..." || OPENAI_API_BASE # オプション | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |
## チュートリアル: スタートアップの開始
```shellpython startup.py "Write a cli snake game"# コードレビューを利用すれば、コストはかかるが、より良いコード品質を選ぶことができます。python startup.py "Write a cli snake game" --code_review True```
スクリプトを実行すると、`workspace/` ディレクトリに新しいプロジェクトが見つかります。### プラットフォームまたはツールの設定
要件を述べるときに、どのプラットフォームまたはツールを使用するかを指定できます。```shellpython startup.py "pygame をベースとした cli ヘビゲームを書く"```### 使用方法
```会社名 startup.py - 私たちは AI で構成されたソフトウェア・スタートアップです。私たちに投資することは、無限の可能性に満ちた未来に力を与えることです。
シノプシス startup.py IDEA <flags>
説明 私たちは AI で構成されたソフトウェア・スタートアップです。私たちに投資することは、無限の可能性に満ちた未来に力を与えることです。
位置引数 IDEA 型: str あなたの革新的なアイデア、例えば"スネークゲームを作る。"など
フラグ --investment=INVESTMENT 型: float デフォルト: 3.0 投資家として、あなたはこの AI 企業に一定の金額を拠出する機会がある。 --n_round=N_ROUND 型: int デフォルト: 5
注意事項 位置引数にフラグ構文を使うこともできます```
### コードウォークスルー
```pythonfrom metagpt.software_company import SoftwareCompanyfrom metagpt.roles import ProjectManager, ProductManager, Architect, Engineer
async def startup(idea: str, investment: float = 3.0, n_round: int = 5): """スタートアップを実行する。ボスになる。""" company = SoftwareCompany() company.hire([ProductManager(), Architect(), ProjectManager(), Engineer()]) company.invest(investment) company.start_project(idea) await company.run(n_round=n_round)```
`examples` でシングル・ロール(ナレッジ・ベース付き)と LLM のみの例を詳しく見ることができます。
## クイックスタートローカル環境のインストールや設定は、ユーザーによっては難しいものです。以下のチュートリアルで MetaGPT の魅力をすぐに体験できます。
- [MetaGPT クイックスタート](https://deepwisdom.feishu.cn/wiki/Q8ycw6J9tiNXdHk66MRcIN8Pnlg)
## お問い合わせ先
このプロジェクトに関するご質問やご意見がございましたら、お気軽にお問い合わせください。皆様のご意見をお待ちしております!
- **Email:** alexanderwu@fuzhi.ai- **GitHub Issues:** 技術的なお問い合わせについては、[GitHub リポジトリ](https://github.com/geekan/metagpt/issues) に新しい issue を作成することもできます。
ご質問には 2-3 営業日以内に回答いた��ます。
## デモ
https://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
## Roadmap
### Long-term Objective
Enable MetaGPT to self-evolve, accomplishing self-training, fine-tuning, optimization, utilization, and updates.
### Short-term Objective
1. Become the multi-agent framework with the highest ROI.2. Support fully automatic implementation of medium-sized projects (around 2000 lines of code).3. Implement most identified tasks, reaching version 0.5.
### Tasks
To reach version v0.5, approximately 70% of the following tasks need to be completed.
1. Usability 1. Release v0.01 pip package to try to solve issues like npm installation (though not necessarily successfully) 2. Support for overall save and recovery of software companies 3. Support human confirmation and modification during the process 4. Support process caching: Consider carefully whether to add server caching mechanism 5. Resolve occasional failure to follow instruction under current prompts, causing code parsing errors, through stricter system prompts 6. Write documentation, describing the current features and usage at all levels 7. ~~Support Docker~~2. Features 1. Support a more standard and stable parser (need to analyze the format that the current LLM is better at) 2. ~~Establish a separate output queue, differentiated from the message queue~~ 3. Attempt to atomize all role work, but this may significantly increase token overhead 4. Complete the design and implementation of module breakdown 5. Support various modes of memory: clearly distinguish between long-term and short-term memory 6. Perfect the test role, and carry out necessary interactions with humans 7. Provide full mode instead of the current fast mode, allowing natural communication between roles 8. Implement SkillManager and the process of incremental Skill learning 9. Automatically get RPM and configure it by calling the corresponding openai page, so that each key does not need to be manually configured3. Strategies 1. Support ReAct strategy 2. Support CoT strategy 3. Support ToT strategy 4. Support Reflection strategy4. Actions 1. Implementation: Search 2. Implementation: Knowledge search, supporting 10+ data formats 3. Implementation: Data EDA 4. Implementation: Review 5. Implementation: Add Document 6. Implementation: Delete Document 7. Implementation: Self-training 8. Implementation: DebugError 9. Implementation: Generate reliable unit tests based on YAPI 10. Implementation: Self-evaluation 11. Implementation: AI Invocation 12. Implementation: Learning and using third-party standard libraries 13. Implementation: Data collection 14. Implementation: AI training 15. Implementation: Run code 16. Implementation: Web access5. Plugins: Compatibility with plugin system6. Tools 1. ~~Support SERPER api~~ 2. ~~Support Selenium apis~~ 3. ~~Support Playwright apis~~7. Roles 1. Perfect the action pool/skill pool for each role 2. Red Book blogger 3. E-commerce seller 4. Data analyst 5. News observer 6. Institutional researcher8. Evaluation 1. Support an evaluation on a game dataset 2. Reproduce papers, implement full skill acquisition for a single game role, achieving SOTA results 3. Support an evaluation on a math dataset 4. Reproduce papers, achieving SOTA results for current mathematical problem solving process9. LLM 1. Support Claude underlying API 2. ~~Support Azure asynchronous API~~ 3. Support streaming version of all APIs 4. ~~Make gpt-3.5-turbo available (HARD)~~10. Other 1. Clean up existing unused code 2. Unify all code styles and establish contribution standards 3. Multi-language support 4. Multi-programming-language support.agent-store-config.yaml+1-1
.agent-store-config.yaml.exampleDeleted-9
.dockerignore+1
Dockerfile+8-10
README.md+1-260
metagpt/web/app.py → app.pyRenamed+56-10
config/config.yaml+58-22
docs/FAQ-EN.mdDeleted-181
docs/README_CN.mdDeleted-201
docs/README_JA.mdDeleted-210
docs/ROADMAP.mdDeleted-84
docs/resources/20230811-214014.jpgDeleted

Large File Pointer Details
- SHA256: 846dd5e2fef8d99fbec5d27346876eb12f9de99a7d6025c570ea27536b80cc39
- Pointer size: 130 Bytes
- Size of remote file: 59.1 kB
docs/resources/MetaGPT-WeChat-Personal.jpegDeleted
docs/resources/MetaGPT-WorkWeChatGroup-6.jpgDeleted

Large File Pointer Details
- SHA256: 8c284f3cc89244a80f5c05db4a5639fb7f0df9fd69a612a730b829942ef7b93c
- Pointer size: 130 Bytes
- Size of remote file: 86.3 kB
docs/resources/MetaGPT-logo.jpegDeleted
docs/resources/MetaGPT-logo.pngDeleted

Large File Pointer Details
- SHA256: 084c8f63f3af75d2e100b287db3a0f1385e90f614e09a7c21080597fa99a294e
- Pointer size: 130 Bytes
- Size of remote file: 50.6 kB
docs/resources/software_company_cd.jpegDeleted
docs/resources/software_company_sd.jpegDeleted
docs/resources/workspace/content_rec_sys/resources/competitive_analysis.pdfDeleted
docs/resources/workspace/content_rec_sys/resources/competitive_analysis.pngDeleted

Large File Pointer Details
- SHA256: 2d6eea5d284c72a93e9995576e357a11d0901ffb74a3e180ddc1666ab263f426
- Pointer size: 130 Bytes
- Size of remote file: 38.7 kB
docs/resources/workspace/content_rec_sys/resources/competitive_analysis.svgDeleted
Large File Pointer Details
- SHA256: 70a8c240a7ac4c447caa47ef7f71268e57d72aca9280dc2a85299ed0eade18b5
- Pointer size: 129 Bytes
- Size of remote file: 5.76 kB
docs/resources/workspace/content_rec_sys/resources/data_api_design.pdfDeleted
docs/resources/workspace/content_rec_sys/resources/data_api_design.pngDeleted

Large File Pointer Details
- SHA256: 9f5a6265915cc4ff672aada5b66e818a024a0aa8d007fd3c684cdca0dd3f7c07
- Pointer size: 131 Bytes
- Size of remote file: 177 kB
docs/resources/workspace/content_rec_sys/resources/data_api_design.svgDeleted
Large File Pointer Details
- SHA256: 89c6067be45e60004f5544b9b34c1bcbaca8f80dfebd3c1d20b1d7a12d10c4e1
- Pointer size: 130 Bytes
- Size of remote file: 44.1 kB
docs/resources/workspace/content_rec_sys/resources/seq_flow.pdfDeleted
docs/resources/workspace/content_rec_sys/resources/seq_flow.pngDeleted

Large File Pointer Details
- SHA256: 67f508c5715d7800ea20380fdbce240f073fa3807d30f7f2660d3aa367a370cf
- Pointer size: 130 Bytes
- Size of remote file: 81.8 kB
docs/resources/workspace/content_rec_sys/resources/seq_flow.svgDeleted
Large File Pointer Details
- SHA256: 00146d187abe04ec54f32cb4e1ad7b94ba500488c682d921a59519fb21f4bdf0
- Pointer size: 130 Bytes
- Size of remote file: 31.3 kB
docs/resources/workspace/llmops_framework/resources/competitive_analysis.pdfDeleted
docs/resources/workspace/llmops_framework/resources/competitive_analysis.pngDeleted

Large File Pointer Details
- SHA256: 2571079e39cd18b9102fca3d2f5725aac96b20ba7a35c8774760ff1444d3a05e
- Pointer size: 130 Bytes
- Size of remote file: 41.4 kB
docs/resources/workspace/llmops_framework/resources/competitive_analysis.svgDeleted
Large File Pointer Details
- SHA256: 9f9660f5d98f28abc490670c1765ecd834788315f6b940d882182601a4766dab
- Pointer size: 129 Bytes
- Size of remote file: 5.75 kB
docs/resources/workspace/llmops_framework/resources/data_api_design.pdfDeleted
docs/resources/workspace/llmops_framework/resources/data_api_design.pngDeleted

Large File Pointer Details
- SHA256: 53c6501dd63c72c6b72504074738b9d3def3878048e8329dc44cb0a58f62d472
- Pointer size: 131 Bytes
- Size of remote file: 147 kB
docs/resources/workspace/llmops_framework/resources/data_api_design.svgDeleted
Large File Pointer Details
- SHA256: 2fbcaa319e9da40211376f076f992004ea1315b8cb9824df6431d333f04b042e
- Pointer size: 130 Bytes
- Size of remote file: 27.7 kB
docs/resources/workspace/llmops_framework/resources/seq_flow.pdfDeleted
docs/resources/workspace/llmops_framework/resources/seq_flow.pngDeleted

Large File Pointer Details
- SHA256: f646a4a4111d3aa0536fc3490f92bfc286e5b86f15faa6d1b3a97dee1712670a
- Pointer size: 131 Bytes
- Size of remote file: 116 kB
docs/resources/workspace/llmops_framework/resources/seq_flow.svgDeleted
Large File Pointer Details
- SHA256: c42cafccb78072cb898e68ebf0297b66c21c4667cd8204dd6c21eedfe1c6c234
- Pointer size: 130 Bytes
- Size of remote file: 30.9 kB
docs/resources/workspace/match3_puzzle_game/resources/competitive_analysis.pdfDeleted
docs/resources/workspace/match3_puzzle_game/resources/competitive_analysis.pngDeleted

Large File Pointer Details
- SHA256: 41722083912101c2ca706227c862f538a77cf4a205910a48089d8dd06039598a
- Pointer size: 130 Bytes
- Size of remote file: 42 kB
docs/resources/workspace/match3_puzzle_game/resources/competitive_analysis.svgDeleted
Large File Pointer Details
- SHA256: 733558b186585157f040ac902262f3022e91ecbb580509b736ff08fdfb3bb848
- Pointer size: 129 Bytes
- Size of remote file: 5.81 kB
docs/resources/workspace/match3_puzzle_game/resources/data_api_design.pdfDeleted
docs/resources/workspace/match3_puzzle_game/resources/data_api_design.pngDeleted

Large File Pointer Details
- SHA256: 8f70036cdde825e4d6f5c5604fbc32e851c5e66073d63d4277d71bdad2784e9c
- Pointer size: 131 Bytes
- Size of remote file: 136 kB
docs/resources/workspace/match3_puzzle_game/resources/data_api_design.svgDeleted
Large File Pointer Details
- SHA256: 954a1fa23b96e6631c7cb84498912ed66e0e23e28f79ecfb6c9bc39de0bfd231
- Pointer size: 130 Bytes
- Size of remote file: 41.2 kB
docs/resources/workspace/match3_puzzle_game/resources/seq_flow.pdfDeleted
docs/resources/workspace/match3_puzzle_game/resources/seq_flow.pngDeleted

Large File Pointer Details
- SHA256: 9d27ace227a29ca395cd5ba90f582712403a1c6a233675b321aaff07bd5c0fa3
- Pointer size: 131 Bytes
- Size of remote file: 119 kB
docs/resources/workspace/match3_puzzle_game/resources/seq_flow.svgDeleted
Large File Pointer Details
- SHA256: 4f8e7ced25c9d15dddec20e83ed202333a88b8f87bf59b6be0cca5310cd67722
- Pointer size: 130 Bytes
- Size of remote file: 35.4 kB
docs/resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.pdfDeleted
docs/resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.pngDeleted

Large File Pointer Details
- SHA256: c1d3b7ed2d3c26f705b5d263f653962dd15e3f28e58830c62d01f8418a7e0d58
- Pointer size: 130 Bytes
- Size of remote file: 36.6 kB
docs/resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.svgDeleted
Large File Pointer Details
- SHA256: af7d31017e16e989211a162f58b77cc7b1b4ddb3b3b6023b916f5260f62cb621
- Pointer size: 129 Bytes
- Size of remote file: 5.24 kB
docs/resources/workspace/minimalist_pomodoro_timer/resources/data_api_design.pdfDeleted
docs/resources/workspace/minimalist_pomodoro_timer/resources/data_api_design.pngDeleted

Large File Pointer Details
- SHA256: 66aba8f103d387da517dd2600dd0e315d6632e4f89fa8117f11c2ead553a245a
- Pointer size: 130 Bytes
- Size of remote file: 32.2 kB