feat: add SSE streaming, thinking models, and modernized Part struct
Some checks failed
Rust / build (push) Has been cancelled
Some checks failed
Rust / build (push) Has been cancelled
This commit is contained in:
@@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user