Skip to content

Commit afdff3e

Browse files
afourneyqingyun-wu
andauthored
Warn if oai.Completion is provided with an empty config_list (microsoft#178)
Co-authored-by: Qingyun Wu <[email protected]>
1 parent 72239a6 commit afdff3e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

autogen/oai/completion.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,13 @@ def yes_or_no_filter(context, config, response):
768768
"""
769769
if ERROR:
770770
raise ERROR
771+
772+
# Warn if a config list was provided but was empty
773+
if type(config_list) is list and len(config_list) == 0:
774+
logger.warning(
775+
"Completion was provided with a config_list, but the list was empty. Adopting default OpenAI behavior, which reads from the 'model' parameter instead."
776+
)
777+
771778
if config_list:
772779
last = len(config_list) - 1
773780
cost = 0

0 commit comments

Comments
 (0)