Open natebosch opened 9 months ago
I'd add fake support - we don't even have a proposed implementation for timeouts in package:http
, do we?
No, we need to solve the upgrade path for client implementations. Once we solve that problem I think the API and implementation questions are manageable.
We could also hold off on adding timeouts in this SDK for now and revisit after http
gets the new feature, or at least a concrete API design.
See https://github.com/google/generative-ai-js/pull/31, https://github.com/google/generative-ai-android/pull/52
The new design allows passing a
requestOptions
argument when creating the model. Currently they cannot be passed togenerateContent
and the other calls like safety settings and generation config, but we can add optional arguments later and it should not be breaking for anyone since the class isfinal
.The initially supported option is a timeout. cc @brianquinlan - Do you think we should punt on this for now until
package:http
supports "real" timeouts which cancel requests, or should we implement faked support for now and update to also cancel the outstanding request when we implement timeouts there?More options may be added later.