From d34073801397546d7669840705c2acca31383384 Mon Sep 17 00:00:00 2001 From: Arnaud Gelas Date: Sat, 13 Jan 2024 15:53:01 +0100 Subject: [PATCH 1/2] Even if you set an investment, the default investment shows in the log --- metagpt/team.py | 1 + 1 file changed, 1 insertion(+) diff --git a/metagpt/team.py b/metagpt/team.py index b98fc2efb..8fd6760f5 100644 --- a/metagpt/team.py +++ b/metagpt/team.py @@ -83,6 +83,7 @@ class Team(BaseModel): """Invest company. raise NoMoneyException when exceed max_budget.""" self.investment = investment CONFIG.max_budget = investment + CONFIG.cost_manager.max_budget = investment logger.info(f"Investment: ${investment}.") @staticmethod From 34b3de1f863e58391009b6180d266872c3c6ac66 Mon Sep 17 00:00:00 2001 From: Arnaud Gelas Date: Sat, 13 Jan 2024 16:10:46 +0100 Subject: [PATCH 2/2] When setting the max budget, I don't want to overcome this limit --- metagpt/team.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/team.py b/metagpt/team.py index 8fd6760f5..aad24efa0 100644 --- a/metagpt/team.py +++ b/metagpt/team.py @@ -88,7 +88,7 @@ class Team(BaseModel): @staticmethod def _check_balance(): - if CONFIG.cost_manager.total_cost > CONFIG.cost_manager.max_budget: + if CONFIG.cost_manager.total_cost >= CONFIG.cost_manager.max_budget: raise NoMoneyException( CONFIG.cost_manager.total_cost, f"Insufficient funds: {CONFIG.cost_manager.max_budget}" )