Using zip files with Gemini

Hey team,Why does gemini no longer take ZIP files?

5 Likes

Uhh, apple devices still can send zip files

can I ask if zip file is good for this use cases: upload 100+ images at the same time? Cuz for now google doesn’t offer batch upload API, which is weird to see, so I really want to find a workaround for that while waiting them to implement it (definitely will happen but not now)

Hi @Assani_moufida ,

As of now, Google AI Studio, as well as the Gemini APIs, support ZIP files. In Google AI Studio, you can directly upload ZIP files in the upload file, and in the Python SDK you can use the following code. Thank you!

    contents = [
        types.Content(
            role="user",
            parts=[
                types.Part.from_bytes(
                    mime_type="application/zip",
                    data=base64.b64decode(
                        """<file-encoded>"""
                    ),
                ),
                types.Part.from_text(text="""WHat is inside this zip file?"""),
            ],
        ),
    ]