Skip to content

Commit

Permalink
Warn if oai.Completion is provided with an empty config_list (#178)
Browse files Browse the repository at this point in the history
Co-authored-by: Qingyun Wu <[email protected]>
  • Loading branch information
afourney and qingyun-wu authored Oct 10, 2023
1 parent 72239a6 commit afdff3e
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 afdff3e

Please sign in to comment.