Asynchronous file upload (google.generativeai.upload_file
) and other blocking methods?
#564
Labels
component:python sdk
Issue/PR related to Python SDK
status:triaged
Issue/PR triaged to the corresponding sub-team
type:feature request
New feature request/enhancement
Description of the feature request:
Currently
google.generativeai.upload_file
is a blocking function, it would be nice if there are async versions of these methods along with other I/O related methods likeget_file
anddelete_file
thoughupload_file
can be made asynchronous if uploading lets say 100mb of file.What problem are you trying to solve with this feature?
Adding asynchronous versions of upload file methods is good in applications where it is async-driven (e.g. Discord bots, web) which currently using this to utilize multimodal features can potentially block the entire script which is not good for such applications
Any other information you'd like to share?
Right now I'm using something like
asyncio.to_thread
to make it asynchronous, but offering a native async methods would be niceRight now there are only two async methods with this SDK are
generate_content
andsend_message
Although it would also be a good idea if adding async variant to SDK as well
The text was updated successfully, but these errors were encountered: