Skip to content

Commit

Permalink
fix(main.py): use model_api_key determined from get_api_key
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu007 committed May 6, 2024
1 parent 918367c commit eec4f3b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions litellm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,12 @@ def completion(

if dynamic_api_key is not None:
api_key = dynamic_api_key
if api_key is None:
# Priority order
# 1. dynamic_api_key of get_llm_provider()
# 2. api_key of Parameters
# 3. model_api_key of get_api_key()
api_key = model_api_key
# check if user passed in any of the OpenAI optional params
optional_params = get_optional_params(
functions=functions,
Expand Down

0 comments on commit eec4f3b

Please sign in to comment.