Skip to content

Commit d8ebf6c

Browse files
authored
Output a warning if attempting to load the OAI_CONFIG_LIST from a file, but the file is not found. (#174)
1 parent fbe82da commit d8ebf6c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

autogen/oai/openai_utils.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,12 @@ def config_list_from_json(
237237
if json_str:
238238
config_list = json.loads(json_str)
239239
else:
240+
config_list_path = os.path.join(file_location, env_or_file)
240241
try:
241-
with open(os.path.join(file_location, env_or_file)) as json_file:
242+
with open(config_list_path) as json_file:
242243
config_list = json.load(json_file)
243244
except FileNotFoundError:
245+
logging.warning(f"The specified config_list file '{config_list_path}' does not exist.")
244246
return []
245247
return filter_config(config_list, filter_dict)
246248

0 commit comments

Comments
 (0)