Skip to content

Commit

Permalink
if config.yaml is not present it will only get env
Browse files Browse the repository at this point in the history
  • Loading branch information
rakesh-krishna-a-s committed May 18, 2023
1 parent a2c76ed commit 370ae0a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions superagi/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ def load_config(cls, config_file: str) -> dict:
env_vars = dict(os.environ)

# Read config file
with open(config_file, 'r') as file:
config_data = yaml.safe_load(file)
try:
with open(config_file, 'r') as file:
config_data = yaml.safe_load(file)
except FileNotFoundError:
config_data = {}

# Merge environment variables and config data
config_data = {**config_data, **env_vars}
Expand Down

0 comments on commit 370ae0a

Please sign in to comment.