Skip to content

feat(js/plugins/google-genai): Increased max download size for inline media...#4656

Open
ifielker wants to merge 2 commits intomainfrom
if-modelUpdates
Open

feat(js/plugins/google-genai): Increased max download size for inline media...#4656
ifielker wants to merge 2 commits intomainfrom
if-modelUpdates

Conversation

@ifielker
Copy link
Collaborator

from 10MB to 100MB (to match API limits).

  • Enabled "External URLs" support for Gemini 2.5/3.0+ models by bypassing media download for public URLs in the downloadRequestMedia middleware.
  • Retained existing download behavior ("Inline Data") for Gemini 2.0 models which do not support external URLs.

Checklist (if applicable):

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ifielker, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Google GenAI plugin's media handling capabilities by increasing the maximum download size for inline media and introducing support for external URLs in newer Gemini models. The changes ensure that the plugin aligns with the latest API features and limits, allowing for more efficient processing of media content while maintaining compatibility with older model versions.

Highlights

  • Increased Media Download Limit: The maximum allowed size for inline media downloads has been increased from 10MB to 100MB, aligning with Google AI API limits.
  • External URL Support for Newer Gemini Models: Enabled direct passing of external HTTP/HTTPS URLs to the API for Gemini 2.5/3.0+ models, bypassing the media download middleware.
  • Gemini 2.0 Media Handling: Maintained the existing behavior for Gemini 2.0 models, which continue to download and inline media from external URLs as they do not support direct external URL references.
  • New Test Coverage: Added new unit tests and example flows to verify the distinct media handling behaviors for Gemini 2.0 and newer models when processing external URLs.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • js/plugins/google-genai/src/googleai/gemini.ts
    • Increased the maximum allowed download size for inline media from 10MB to 100MB.
    • Introduced a conditional check for Gemini 2.0 models to differentiate media handling logic.
    • Modified the media download filter to bypass downloading external HTTP/HTTPS URLs for Gemini models newer than 2.0.
  • js/plugins/google-genai/tests/googleai/gemini_test.ts
    • Added a new test suite for media handling to verify external URL behavior.
    • Included a test case to confirm that non-Gemini 2.0 models pass external URLs directly to the API as fileUri.
  • js/testapps/basic-gemini/src/index.ts
    • Added new test flows to demonstrate external URL handling for Gemini 2.0 models, showing the download and inline approach.
    • Added new test flows to demonstrate external URL handling for Gemini 3.0 models, showing the direct fileUri approach.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request increases the maximum download size for inline media from 10MB to 100MB and introduces logic to bypass media download for public URLs for Gemini 2.5/3.0+ models, while retaining it for Gemini 2.0 models. New tests and test flows have been added to validate this behavior. The changes are well-implemented and address the stated objectives.

@ifielker ifielker requested a review from pavelgj February 14, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants