Skip to content

fix(gemini): support file retrieval in GoogleAIStudioFilesHandle#20018

Merged
Sameerlite merged 1 commit intoBerriAI:litellm_oss_staging_01_29_2026from
varunsripad123:fix/google-files-retrieval
Jan 30, 2026
Merged

fix(gemini): support file retrieval in GoogleAIStudioFilesHandle#20018
Sameerlite merged 1 commit intoBerriAI:litellm_oss_staging_01_29_2026from
varunsripad123:fix/google-files-retrieval

Conversation

@varunsripad123
Copy link

ixes #20007
This PR implements file_retrieve support in GoogleAIStudioFilesHandler. Previously, attempting to retrieve a file (e.g., to check status) would raise a NotImplementedError or return 500, making it impossible to check if a file was ACTIVE before use.

Changes

  • Implemented transform_retrieve_file_request in litellm/llms/gemini/files/transformation.py to construct the correct Google AI Studio API URL (v1beta/files/{file_id}).
  • Implemented transform_retrieve_file_response to map Gemini file states (ACTIVE, PROCESSING, FAILED) to standard OpenAI statuses (processed, uploaded, error).

Testing

  • Verified manually with a reproduction script testing URL construction and status mapping.

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Error Error Jan 29, 2026 9:17pm

Request Review

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Varun Sripad seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Sameerlite Sameerlite changed the base branch from main to litellm_oss_staging_01_29_2026 January 30, 2026 10:38
Copy link
Collaborator

@Sameerlite Sameerlite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sameerlite Sameerlite merged commit ed4c71e into BerriAI:litellm_oss_staging_01_29_2026 Jan 30, 2026
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants