irthomasthomas / undecidability

1 stars 0 forks source link

MetaGPT - Multi-agent framework #727

Open irthomasthomas opened 1 month ago

irthomasthomas commented 1 month ago

Quickstart | MetaGPT

Description: Quickstart

Installation

pip install metagpt

Available installation methods can be found in the Installation section.

Configuration

Variations for setting up LLM API (OpenAI, Azure, Anthropic, etc.) and other components can be found in the Configuration section.

For formal usage of MetaGPT, using a config2.yaml. See Configuration.

Develop software with a one-line requirement

Note: Below is a breakdown of the software startup example. If you install MetaGPT with the git clone approach, simply run

metagpt "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

import asyncio
from metagpt.roles import (
    Architect,
    Engineer,
    ProductManager,
    ProjectManager,
)
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

async def startup(idea: str):
    company = Team()
    company.hire(
        [
            ProductManager(),
            Architect(),
            ProjectManager(),
            Engineer(),
        ]
    )
    company.invest(investment=3.0)
    company.run_project(idea=idea)

    await company.run(n_round=5)

Finally, run it and get the code!

await startup(idea="write a cli blackjack game")

You may expect similar outputs below:

Usage

Usage: metagpt [OPTIONS] [IDEA]

Start a new project.

Arguments:

Options:

Source

Suggested labels

irthomasthomas commented 1 month ago

Related content

383

Similarity score: 0.89

499

Similarity score: 0.88

682

Similarity score: 0.88

707

Similarity score: 0.88

498

Similarity score: 0.87

660

Similarity score: 0.87