change investment keyword

This commit is contained in:
geekan 2023-07-03 13:51:59 +08:00
parent f6955b32b3
commit e66c0cf012
2 changed files with 3 additions and 4 deletions

View file

@ -34,9 +34,8 @@ class SoftwareCompany:
"""Hire roles to cooperate"""
self.environment.add_roles(roles)
def invest(self, money: str):
def invest(self, investment: float):
"""Invest company. raise NoMoneyException when exceed max_budget."""
investment = float(money.strip("$"))
self.investment = investment
self.config.max_budget = investment

View file

@ -6,7 +6,7 @@ from metagpt.software_company import SoftwareCompany
from metagpt.roles import ProjectManager, ProductManager, Architect, Engineer
async def startup(idea: str, investment: str = "$3.0", n_round: int = 5):
async 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(n_borg=5)])
@ -15,7 +15,7 @@ async def startup(idea: str, investment: str = "$3.0", n_round: int = 5):
await company.run(n_round=n_round)
def main(idea: str, investment: str = "$3.0"):
def main(idea: str, investment: float = 3.0):
"""
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."