fix(main.py): use model_api_key determined from get_api_key

This commit is contained in:
jinno 2024-04-28 21:06:37 +09:00
parent 918367cc7b
commit eec4f3bda7

View file

@ -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,