feat: replaced with OPTIONS

This commit is contained in:
莘权 马 2023-08-28 17:45:45 +08:00
parent 3a1ebf19b7
commit 143ffb0c2c
39 changed files with 144 additions and 252 deletions

View file

@ -1,10 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Modified By: mashenquan, 2023/8/20. Remove global configuration `CONFIG`, enable configuration support for business isolation;
Change cost control from global to company level.
"""
import asyncio
import platform
import fire
@ -16,15 +11,14 @@ 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):
"""Run a startup. Be a boss."""
company = SoftwareCompany()
company.hire([ProductManager(options=company.options, cost_manager=company.cost_manager),
Architect(options=company.options, cost_manager=company.cost_manager),
ProjectManager(options=company.options, cost_manager=company.cost_manager),
Engineer(n_borg=5, use_code_review=code_review, options=company.options, cost_manager=company.cost_manager)])
company.hire([ProductManager(),
Architect(),
ProjectManager(),
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!)
company.hire([QaEngineer(options=company.options, cost_manager=company.cost_manager)])
company.hire([QaEngineer()])
company.invest(investment)
company.start_project(idea)
await company.run(n_round=n_round)