mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-24 14:15:17 +02:00
feat: option to skip hiring an engineer with implement=False
This commit is contained in:
parent
65500204b8
commit
9aa36db163
2 changed files with 60 additions and 25 deletions
50
startup.py
50
startup.py
|
|
@ -4,38 +4,64 @@ import asyncio
|
|||
import platform
|
||||
import fire
|
||||
|
||||
from metagpt.roles import Architect, Engineer, ProductManager, ProjectManager, QaEngineer
|
||||
from metagpt.roles import Architect, Engineer, ProductManager
|
||||
from metagpt.roles import ProjectManager, QaEngineer
|
||||
from metagpt.software_company import SoftwareCompany
|
||||
|
||||
|
||||
async def startup(idea: str, investment: float = 3.0, n_round: int = 5,
|
||||
code_review: bool = False, run_tests: bool = False):
|
||||
async def startup(
|
||||
idea: str,
|
||||
investment: float = 3.0,
|
||||
n_round: int = 5,
|
||||
code_review: bool = False,
|
||||
run_tests: bool = False,
|
||||
implement: bool = True
|
||||
):
|
||||
"""Run a startup. Be a boss."""
|
||||
company = SoftwareCompany()
|
||||
company.hire([ProductManager(),
|
||||
Architect(),
|
||||
ProjectManager(),
|
||||
Engineer(n_borg=5, use_code_review=code_review)])
|
||||
company.hire([
|
||||
ProductManager(),
|
||||
Architect(),
|
||||
ProjectManager(),
|
||||
])
|
||||
|
||||
# if implement or code_review
|
||||
if implement or code_review:
|
||||
# developing features: implement the idea
|
||||
company.hire([Engineer(n_borg=5, use_code_review=code_review)])
|
||||
|
||||
if run_tests:
|
||||
# developing features: run tests on the spot and identify bugs (bug fixing capability comes soon!)
|
||||
# developing features: run tests on the spot and identify bugs
|
||||
# (bug fixing capability comes soon!)
|
||||
company.hire([QaEngineer()])
|
||||
|
||||
company.invest(investment)
|
||||
company.start_project(idea)
|
||||
await company.run(n_round=n_round)
|
||||
|
||||
|
||||
def main(idea: str, investment: float = 3.0, n_round: int = 5, code_review: bool = False, run_tests: bool = False):
|
||||
def main(
|
||||
idea: str,
|
||||
investment: float = 3.0,
|
||||
n_round: int = 5,
|
||||
code_review: bool = False,
|
||||
run_tests: bool = False,
|
||||
implement: bool = False
|
||||
):
|
||||
"""
|
||||
We are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities.
|
||||
We are a software startup comprised of AI. By investing in us,
|
||||
you are empowering a future filled with limitless possibilities.
|
||||
:param idea: Your innovative idea, such as "Creating a snake game."
|
||||
:param investment: As an investor, you have the opportunity to contribute a certain dollar amount to this AI company.
|
||||
:param investment: As an investor, you have the opportunity to contribute
|
||||
a certain dollar amount to this AI company.
|
||||
:param n_round:
|
||||
:param code_review: Whether to use code review.
|
||||
:return:
|
||||
"""
|
||||
if platform.system() == "Windows":
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
asyncio.run(startup(idea, investment, n_round, code_review, run_tests))
|
||||
asyncio.run(startup(idea, investment, n_round,
|
||||
code_review, run_tests, implement))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue