(fix) completion: max_retries using OpenAI client

This commit is contained in:
ishaan-jaff 2023-11-20 16:53:18 -08:00
parent 2bd934e56c
commit 11ec2710c6
4 changed files with 19 additions and 16 deletions

View file

@ -1759,6 +1759,7 @@ def get_optional_params( # use the openai defaults
seed=None,
tools=None,
tool_choice=None,
max_retries=None,
**kwargs
):
# retrieve all parameters passed to the function
@ -1784,7 +1785,8 @@ def get_optional_params( # use the openai defaults
"response_format": None,
"seed": None,
"tools": None,
"tool_choice": None
"tool_choice": None,
"max_retries": None,
}
# filter out those parameters that were passed with non-default values
non_default_params = {k: v for k, v in passed_params.items() if (k != "model" and k != "custom_llm_provider" and k in default_params and v != default_params[k])}
@ -2178,7 +2180,7 @@ def get_optional_params( # use the openai defaults
temperature = 0.0001 # close to 0
optional_params["temperature"] = temperature
else: # assume passing in params for openai/azure openai
supported_params = ["functions", "function_call", "temperature", "top_p", "n", "stream", "stop", "max_tokens", "presence_penalty", "frequency_penalty", "logit_bias", "user", "response_format", "seed", "tools", "tool_choice"]
supported_params = ["functions", "function_call", "temperature", "top_p", "n", "stream", "stop", "max_tokens", "presence_penalty", "frequency_penalty", "logit_bias", "user", "response_format", "seed", "tools", "tool_choice", "max_retries"]
_check_valid_arg(supported_params=supported_params)
optional_params = non_default_params
# if user passed in non-default kwargs for specific providers/models, pass them along