From a6e18ae31b53014534b7af51bc7b7ef17f870b46 Mon Sep 17 00:00:00 2001 From: Chesars Date: Tue, 3 Mar 2026 15:36:45 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20address=20review=20feedback=20=E2=80=94?= =?UTF-8?q?=20type=20OpenAICredentials.api=5Fbase=20as=20str,=20remove=20d?= =?UTF-8?q?ead=20vertex=5Fai=20block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - OpenAICredentials.api_base is always non-None due to fallback default, so type it as str instead of Optional[str] - Remove unreachable elif vertex_ai block in create_file(); vertex_ai is already handled by ProviderConfigManager via provider_config path --- litellm/files/main.py | 26 -------------------------- litellm/llms/openai/common_utils.py | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/litellm/files/main.py b/litellm/files/main.py index f626f9b3466..1f4d15abb81 100644 --- a/litellm/files/main.py +++ b/litellm/files/main.py @@ -216,32 +216,6 @@ def create_file( create_file_data=_create_file_request, litellm_params=litellm_params_dict, ) - elif custom_llm_provider == "vertex_ai": - api_base = optional_params.api_base or "" - vertex_ai_project = ( - optional_params.vertex_project - or litellm.vertex_project - or get_secret_str("VERTEXAI_PROJECT") - ) - vertex_ai_location = ( - optional_params.vertex_location - or litellm.vertex_location - or get_secret_str("VERTEXAI_LOCATION") - ) - vertex_credentials = optional_params.vertex_credentials or get_secret_str( - "VERTEXAI_CREDENTIALS" - ) - - response = vertex_ai_files_instance.create_file( - _is_async=_is_async, - api_base=api_base, - vertex_project=vertex_ai_project, - vertex_location=vertex_ai_location, - vertex_credentials=vertex_credentials, - timeout=timeout, - max_retries=optional_params.max_retries, - create_file_data=_create_file_request, - ) else: raise litellm.exceptions.BadRequestError( message="LiteLLM doesn't support {} for 'create_file'. Only ['openai', 'azure', 'vertex_ai', 'manus'] are supported.".format( diff --git a/litellm/llms/openai/common_utils.py b/litellm/llms/openai/common_utils.py index 069448eba07..b6b302782e8 100644 --- a/litellm/llms/openai/common_utils.py +++ b/litellm/llms/openai/common_utils.py @@ -246,7 +246,7 @@ class BaseOpenAILLM: class OpenAICredentials(NamedTuple): - api_base: Optional[str] + api_base: str api_key: Optional[str] organization: Optional[str]