Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn if oai.Completion is provided with an empty config_list #178

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading