Skip to content

Commit

Permalink
Warn if oai.Completion is provided with an empty config_list
Browse files Browse the repository at this point in the history
  • Loading branch information
afourney committed Oct 9, 2023
1 parent 4522900 commit a72d2a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autogen/oai/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a72d2a1

Please sign in to comment.