mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
use CONFIG to adapt pydantic..
This commit is contained in:
parent
e5d70f3f21
commit
4719bbeb7f
3 changed files with 26 additions and 17 deletions
|
|
@ -57,7 +57,7 @@ class Config(metaclass=Singleton):
|
|||
self.google_api_key = self._get('GOOGLE_API_KEY')
|
||||
self.google_cse_id = self._get('GOOGLE_CSE_ID')
|
||||
self.search_engine = self._get('SEARCH_ENGINE', SearchEngineType.SERPAPI_GOOGLE)
|
||||
self.max_budget = self._get('MAX_BUDGET', 10)
|
||||
self.max_budget = self._get('MAX_BUDGET', 10.0)
|
||||
self.total_cost = 0.0
|
||||
|
||||
def _init_with_config_files_and_env(self, configs: dict, yaml_file):
|
||||
|
|
@ -85,3 +85,6 @@ class Config(metaclass=Singleton):
|
|||
if value is None:
|
||||
raise ValueError(f"Key '{key}' not found in environment variables or in the YAML file")
|
||||
return value
|
||||
|
||||
|
||||
CONFIG = Config()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue