diff --git a/autogen/oai/completion.py b/autogen/oai/completion.py index fa01616128ad..595cbe3bed00 100644 --- a/autogen/oai/completion.py +++ b/autogen/oai/completion.py @@ -768,6 +768,13 @@ def yes_or_no_filter(context, config, response): """ if ERROR: raise ERROR + + # Warn if a config list was provided but was empty + if type(config_list) is list and len(config_list) == 0: + logger.warning( + "Completion was provided with a config_list, but the list was empty. Adopting default OpenAI behavior, which reads from the 'model' parameter instead." + ) + if config_list: last = len(config_list) - 1 cost = 0