fix: address review feedback — type OpenAICredentials.api_base as str, remove dead vertex_ai block

- 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
This commit is contained in:
Chesars 2026-03-03 15:36:45 -03:00
parent ead74dff11
commit a6e18ae31b
2 changed files with 1 additions and 27 deletions

View file

@ -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(

View file

@ -246,7 +246,7 @@ class BaseOpenAILLM:
class OpenAICredentials(NamedTuple):
api_base: Optional[str]
api_base: str
api_key: Optional[str]
organization: Optional[str]