Adds streaming generation that returns a streaming

- Introducues generate_content_stream that returns a Tokio Steam instead
of a Queue. This allows using the standard stream APIs from
tokio-streams.
- Replace future-utils with tokio-streams, mainly due to better
ergonomics for using the filter_map stream combinator.
This commit is contained in:
2025-04-05 19:18:33 +01:00
parent de9b14b984
commit 51d6a27017
8 changed files with 84 additions and 73 deletions

View File

@@ -7,7 +7,7 @@ pub trait TokenProvider {
-> impl std::future::Future<Output = Result<String>> + Send;
}
impl<'a> TokenProvider for Arc<dyn gcp_auth::TokenProvider + 'a> {
impl TokenProvider for Arc<dyn gcp_auth::TokenProvider> {
async fn get_token(&self, scope: &[&str]) -> Result<String> {
let token = self.token(scope).await;
match token {