feat: add SSE streaming, thinking models, and modernized Part struct
Some checks failed
Rust / build (push) Has been cancelled

This commit is contained in:
2026-09-20 16:42:55 +01:00
parent ad82fc712b
commit 494aab6d14
18 changed files with 703 additions and 696 deletions

View File

@@ -1,18 +1,18 @@
use std::sync::Arc;
use crate::error::Result;
pub trait TokenProvider {
fn get_token(&self, scope: &[&str])
-> impl std::future::Future<Output = Result<String>> + Send;
}
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 {
Ok(token) => Ok(token.as_str().to_string()),
Err(e) => Err(e.into()),
}
}
}
use std::sync::Arc;
use crate::error::Result;
pub trait TokenProvider {
fn get_token(&self, scope: &[&str])
-> impl std::future::Future<Output = Result<String>> + Send;
}
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 {
Ok(token) => Ok(token.as_str().to_string()),
Err(e) => Err(e.into()),
}
}
}