Gemini API with Python 2.7

is there a way to use Gemini API with Python 2.7?

Hi @Mohamed_Shams,

Perquisite for Gemini API is python 3.9+.

Documentation : জেমিনি API কুইকস্টার্ট  |  Gemini API  |  Google for Developers

Thanks

You can make JSON calls to the API with normal REST techniques instead of protos.

You may need to do a bit more work to do any authentication beyond a service account API key passed in header as authentication.

The CURL examples in documentation can show what you need to construct - and then you need to parse out the response parts. Streaming SSE subscription will be another task not done for you, where you have to handle reconstructing more than just text responses if you have functions or code.

Python 2 is basically dead now, and even hold-out distros are pulling it from default installs. So while you can make your own API shim that is versatile and where you don’t constantly have go figuring out how something was written, you’d be writing for just yourself.