BerriAI/litellm · error · ValueError
Error parsing file delete response: {e}
Error message
Error parsing file delete response: {e} What it means
Error "Error parsing file delete response: {e}" thrown in BerriAI/litellm.
Source
Thrown at litellm/llms/gemini/files/transformation.py:364
try:
# Google AI Studio returns {} on successful deletion
if raw_response.status_code == 200:
# Extract file ID from the request URL if possible
file_id = "deleted"
if hasattr(raw_response, "request") and raw_response.request:
url: Final = str(raw_response.request.url)
if "/files/" in url:
file_id = url.split("/files/")[-1].split("?")[0]
# Add the files/ prefix if not present
if not file_id.startswith("files/"):
file_id = f"files/{file_id}"
return FileDeleted(id=file_id, deleted=True, object="file")
else:
raise ValueError(f"Failed to delete file: {raw_response.text}")
except Exception as e:
verbose_logger.exception("Error parsing file delete response: %s", e)
raise ValueError(f"Error parsing file delete response: {e}")
def transform_list_files_request(
self,
purpose: str | None,
optional_params: dict,
litellm_params: dict,
) -> tuple[str, dict]:
raise NotImplementedError("GoogleAIStudioFilesHandler does not support file listing")
def transform_list_files_response(
self,
raw_response: httpx.Response,
logging_obj: LiteLLMLoggingObj,
litellm_params: dict,
) -> list[OpenAIFileObject]:
raise NotImplementedError("GoogleAIStudioFilesHandler does not support file listing")
def transform_file_content_request(View on GitHub (pinned to 6c2dcb801b)
Solutions
- Check the Gemini file delete response format; see the wrapped exception.
When it happens
Trigger: Thrown at litellm/llms/gemini/files/transformation.py:364 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/ac67a1a980bda272.
Report an issue: GitHub.