mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
test_pre_process_non_default_params (#13990)
This commit is contained in:
parent
6696955506
commit
ab7efaa832
3 changed files with 9 additions and 9 deletions
|
|
@ -1256,6 +1256,7 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
additional_drop_params=kwargs.get("additional_drop_params"),
|
||||
remove_sensitive_keys=True,
|
||||
add_provider_specific_params=True,
|
||||
provider_config=provider_config,
|
||||
)
|
||||
|
||||
if litellm.add_function_to_prompt and optional_params.get(
|
||||
|
|
|
|||
|
|
@ -3088,6 +3088,7 @@ def pre_process_non_default_params(
|
|||
model: str,
|
||||
remove_sensitive_keys: bool = False,
|
||||
add_provider_specific_params: bool = False,
|
||||
provider_config: Optional[BaseConfig] = None,
|
||||
) -> dict:
|
||||
"""
|
||||
Pre-process non-default params to a standardized format
|
||||
|
|
@ -3103,14 +3104,6 @@ def pre_process_non_default_params(
|
|||
additional_endpoint_specific_params=["messages"],
|
||||
)
|
||||
|
||||
provider_config: Optional[BaseConfig] = None
|
||||
if custom_llm_provider is not None and custom_llm_provider in [
|
||||
provider.value for provider in LlmProviders
|
||||
]:
|
||||
provider_config = ProviderConfigManager.get_provider_chat_config(
|
||||
model=model, provider=LlmProviders(custom_llm_provider)
|
||||
)
|
||||
|
||||
if "response_format" in non_default_params:
|
||||
if provider_config is not None:
|
||||
non_default_params[
|
||||
|
|
|
|||
|
|
@ -957,7 +957,12 @@ def test_get_model_info_shows_supports_computer_use():
|
|||
def test_pre_process_non_default_params(model, custom_llm_provider):
|
||||
from pydantic import BaseModel
|
||||
|
||||
from litellm.utils import pre_process_non_default_params
|
||||
from litellm.utils import ProviderConfigManager, pre_process_non_default_params
|
||||
|
||||
provider_config = ProviderConfigManager.get_provider_chat_config(
|
||||
model=model,
|
||||
provider=LlmProviders(custom_llm_provider)
|
||||
)
|
||||
|
||||
class ResponseFormat(BaseModel):
|
||||
x: str
|
||||
|
|
@ -974,6 +979,7 @@ def test_pre_process_non_default_params(model, custom_llm_provider):
|
|||
special_params=special_params,
|
||||
custom_llm_provider=custom_llm_provider,
|
||||
additional_drop_params=None,
|
||||
provider_config=provider_config,
|
||||
)
|
||||
print(processed_non_default_params)
|
||||
assert processed_non_default_params == {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue