mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
Merge pull request #745 from arnaudgelas/fix/investment
Even if you set an investment, the default investment shows in the log
This commit is contained in:
commit
d1166e97b2
1 changed files with 2 additions and 1 deletions
|
|
@ -83,11 +83,12 @@ 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
|
||||
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}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue