google-gemini / generative-ai-js

The official Node.js / Typescript library for the Google Gemini API
https://www.npmjs.com/package/@google/generative-ai
Apache License 2.0
679 stars 141 forks source link

Add sample demonstrating how to using polling to check file state #146

Open hsubox76 opened 4 months ago

hsubox76 commented 4 months ago

Description of the bug:

Files uploaded with the Files API may not be processed immediately and need to be checked by polling periodically with getFile and checking the state until it has turned to ACTIVE. We should add a simple implementation of this (probably poll every 10 seconds using Promise/setTimeout) to the samples folder.

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response