From c65a438de2474d8e0d02e09be28020c67539d2dc Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 30 Jul 2024 18:38:10 -0700 Subject: [PATCH] fix(utils.py): fix linting errors --- litellm/router.py | 1 + litellm/utils.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index fcbd3a230..108ca706c 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -3865,6 +3865,7 @@ class Router: if supported_openai_params is None: supported_openai_params = [] model_info = ModelMapInfo( + key=model_group, max_tokens=None, max_input_tokens=None, max_output_tokens=None, diff --git a/litellm/utils.py b/litellm/utils.py index a32c67d03..fe65e415b 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2148,7 +2148,7 @@ def supports_parallel_function_calling(model: str): ####### HELPER FUNCTIONS ################ -def _update_dictionary(existing_dict: dict, new_dict: dict) -> dict: +def _update_dictionary(existing_dict: Dict, new_dict: dict) -> dict: for k, v in new_dict.items(): existing_dict[k] = v @@ -2179,14 +2179,14 @@ def register_model(model_cost: Union[str, dict]): for key, value in loaded_model_cost.items(): ## get model info ## try: - existing_model = get_model_info(model=key) + existing_model: Union[ModelInfo, dict] = get_model_info(model=key) model_cost_key = existing_model["key"] except Exception: existing_model = {} model_cost_key = key ## override / add new keys to the existing model cost dictionary litellm.model_cost.setdefault(model_cost_key, {}).update( - _update_dictionary(existing_model, value) + _update_dictionary(existing_model, value) # type: ignore ) verbose_logger.debug(f"{key} added to model cost map") # add new model names to provider lists