From f12b8bf2c187c93d7a90bc3e7d08ad93dff0937a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Gar=C3=A9?= <90070734+FelipeRodriguesGare@users.noreply.github.com> Date: Wed, 8 Oct 2025 17:42:34 -0300 Subject: [PATCH] feat(files): add @client decorator to file operations (#15339) - Decorate sync/async file APIs (retrieve, delete, list, content) with @client - Ensures calls route through the configured client, honoring provider/client config - Standardizes behavior across file endpoints and aligns with existing patterns - No API signature changes; improves consistency and client-bound usage --- litellm/files/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litellm/files/main.py b/litellm/files/main.py index 18be2c702b..144b929132 100644 --- a/litellm/files/main.py +++ b/litellm/files/main.py @@ -268,6 +268,7 @@ def create_file( raise e +@client async def afile_retrieve( file_id: str, custom_llm_provider: Literal["openai", "azure"] = "openai", @@ -308,6 +309,7 @@ async def afile_retrieve( raise e +@client def file_retrieve( file_id: str, custom_llm_provider: Literal["openai", "azure"] = "openai", @@ -422,6 +424,7 @@ def file_retrieve( # Delete file +@client async def afile_delete( file_id: str, custom_llm_provider: Literal["openai", "azure"] = "openai", @@ -462,6 +465,7 @@ async def afile_delete( raise e +@client def file_delete( file_id: str, custom_llm_provider: Literal["openai", "azure"] = "openai", @@ -577,6 +581,7 @@ def file_delete( # List files +@client async def afile_list( custom_llm_provider: Literal["openai", "azure"] = "openai", purpose: Optional[str] = None, @@ -617,6 +622,7 @@ async def afile_list( raise e +@client def file_list( custom_llm_provider: Literal["openai", "azure"] = "openai", purpose: Optional[str] = None, @@ -729,6 +735,7 @@ def file_list( raise e +@client async def afile_content( file_id: str, custom_llm_provider: Literal["openai", "azure", "vertex_ai"] = "openai", @@ -771,6 +778,7 @@ async def afile_content( raise e +@client def file_content( file_id: str, model: Optional[str] = None,