mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
Output a warning if attempting to load the OAI_CONFIG_LIST from a file, but the file is not found. (#174)
This commit is contained in:
@@ -237,10 +237,12 @@ def config_list_from_json(
|
||||
if json_str:
|
||||
config_list = json.loads(json_str)
|
||||
else:
|
||||
config_list_path = os.path.join(file_location, env_or_file)
|
||||
try:
|
||||
with open(os.path.join(file_location, env_or_file)) as json_file:
|
||||
with open(config_list_path) as json_file:
|
||||
config_list = json.load(json_file)
|
||||
except FileNotFoundError:
|
||||
logging.warning(f"The specified config_list file '{config_list_path}' does not exist.")
|
||||
return []
|
||||
return filter_config(config_list, filter_dict)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user