Skip to content

Commit f12b8bf

Browse files
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
1 parent 0b6b69c commit f12b8bf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

litellm/files/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ def create_file(
268268
raise e
269269

270270

271+
@client
271272
async def afile_retrieve(
272273
file_id: str,
273274
custom_llm_provider: Literal["openai", "azure"] = "openai",
@@ -308,6 +309,7 @@ async def afile_retrieve(
308309
raise e
309310

310311

312+
@client
311313
def file_retrieve(
312314
file_id: str,
313315
custom_llm_provider: Literal["openai", "azure"] = "openai",
@@ -422,6 +424,7 @@ def file_retrieve(
422424

423425

424426
# Delete file
427+
@client
425428
async def afile_delete(
426429
file_id: str,
427430
custom_llm_provider: Literal["openai", "azure"] = "openai",
@@ -462,6 +465,7 @@ async def afile_delete(
462465
raise e
463466

464467

468+
@client
465469
def file_delete(
466470
file_id: str,
467471
custom_llm_provider: Literal["openai", "azure"] = "openai",
@@ -577,6 +581,7 @@ def file_delete(
577581

578582

579583
# List files
584+
@client
580585
async def afile_list(
581586
custom_llm_provider: Literal["openai", "azure"] = "openai",
582587
purpose: Optional[str] = None,
@@ -617,6 +622,7 @@ async def afile_list(
617622
raise e
618623

619624

625+
@client
620626
def file_list(
621627
custom_llm_provider: Literal["openai", "azure"] = "openai",
622628
purpose: Optional[str] = None,
@@ -729,6 +735,7 @@ def file_list(
729735
raise e
730736

731737

738+
@client
732739
async def afile_content(
733740
file_id: str,
734741
custom_llm_provider: Literal["openai", "azure", "vertex_ai"] = "openai",
@@ -771,6 +778,7 @@ async def afile_content(
771778
raise e
772779

773780

781+
@client
774782
def file_content(
775783
file_id: str,
776784
model: Optional[str] = None,

0 commit comments

Comments
 (0)