Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for resumable uploads for File API #275

Merged
merged 4 commits into from
May 13, 2024

Conversation

TYMichaelChen
Copy link
Contributor

Add support for resumable uploads by following the MediaFileUpload class in Python:

https://googleapis.github.io/google-api-python-client/docs/epy/googleapiclient.http.MediaFileUpload-class.html

Add some pydocs to clarify what the parameters specified are. Confirmed this is working locally:

image

@TYMichaelChen TYMichaelChen requested a review from a team as a code owner April 10, 2024 22:02
@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:python sdk Issue/PR related to Python SDK labels Apr 10, 2024
@@ -59,6 +59,8 @@ def create_file(
mime_type: str | None = None,
name: str | None = None,
display_name: str | None = None,
resumable: bool | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we exposing too many details here?

Do we need the resumable arg, could it just be resumable=chunk_size is not None?

Is there a reasonable default policy we could implement like "if the file is over (2x)MB use resumable with chunk size (x)MB"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, fair point. After some exploration, how about let's start simple and just allow users to set resumable as a boolean flag? The chunk size needs to be a multiple of a certain size and is unfriendly for developers.

@MarkDaoust MarkDaoust merged commit efead6b into google-gemini:main May 13, 2024
7 checks passed
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants