forked from phoenix/litellm-mirror
fix(utils.py): handle else block for get optional params
This commit is contained in:
parent
5e12307a48
commit
ea30359b38
1 changed files with 26 additions and 3 deletions
|
@ -6062,9 +6062,9 @@ def get_optional_params(
|
||||||
model=model,
|
model=model,
|
||||||
api_version=api_version, # type: ignore
|
api_version=api_version, # type: ignore
|
||||||
)
|
)
|
||||||
else: # assume passing in params for azure openai
|
else: # assume passing in params for text-completion openai
|
||||||
supported_params = get_supported_openai_params(
|
supported_params = get_supported_openai_params(
|
||||||
model=model, custom_llm_provider="azure"
|
model=model, custom_llm_provider="custom_openai"
|
||||||
)
|
)
|
||||||
_check_valid_arg(supported_params=supported_params)
|
_check_valid_arg(supported_params=supported_params)
|
||||||
if functions is not None:
|
if functions is not None:
|
||||||
|
@ -6614,7 +6614,30 @@ def get_supported_openai_params(
|
||||||
]
|
]
|
||||||
elif custom_llm_provider == "watsonx":
|
elif custom_llm_provider == "watsonx":
|
||||||
return litellm.IBMWatsonXAIConfig().get_supported_openai_params()
|
return litellm.IBMWatsonXAIConfig().get_supported_openai_params()
|
||||||
|
elif custom_llm_provider == "custom_openai" or "text-completion-openai":
|
||||||
|
return [
|
||||||
|
"functions",
|
||||||
|
"function_call",
|
||||||
|
"temperature",
|
||||||
|
"top_p",
|
||||||
|
"n",
|
||||||
|
"stream",
|
||||||
|
"stream_options",
|
||||||
|
"stop",
|
||||||
|
"max_tokens",
|
||||||
|
"presence_penalty",
|
||||||
|
"frequency_penalty",
|
||||||
|
"logit_bias",
|
||||||
|
"user",
|
||||||
|
"response_format",
|
||||||
|
"seed",
|
||||||
|
"tools",
|
||||||
|
"tool_choice",
|
||||||
|
"max_retries",
|
||||||
|
"logprobs",
|
||||||
|
"top_logprobs",
|
||||||
|
"extra_headers",
|
||||||
|
]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue