google-gemini / generative-ai-python

The official Python library for the Google Gemini API
https://pypi.org/project/google-generativeai/
Apache License 2.0
1.62k stars 322 forks source link

Batched inputs to genai python api #555

Open DavidePaglieri opened 2 months ago

DavidePaglieri commented 2 months ago

Description of the feature request:

Is it possible to have batched inputs with the genai python api? Currently from the documentation I see that only Vertex AI supports batched prediction for Gemini

It seems like a crucial feature to have for widespread gemini adoption to allow batched inputs directly from this genai python api. Openai python api supports it, and it is quite convenient. Would it be possible to add this feature?

What problem are you trying to solve with this feature?

This would be very useful in cases we want to have large batches of predictions with gemini directly from python, without having to go through vertex ai. Would be overall a convenient feature to have.