Struct GoogleAIAuth
pub struct GoogleAIAuth { /* private fields */ }Expand description
Google AI API key authentication.
The API key is included as a query parameter in the WebSocket URL.
Implementations§
§impl GoogleAIAuth
impl GoogleAIAuth
pub fn new(api_key: impl Into<String>) -> GoogleAIAuth
pub fn new(api_key: impl Into<String>) -> GoogleAIAuth
Create a new Google AI auth provider with the given API key.
Trait Implementations§
§impl AuthProvider for GoogleAIAuth
impl AuthProvider for GoogleAIAuth
§fn ws_url(&self, _model: &GeminiModel) -> String
fn ws_url(&self, _model: &GeminiModel) -> String
Build the WebSocket URL for the given model.
§fn rest_url(
&self,
endpoint: ServiceEndpoint,
model: Option<&GeminiModel>,
) -> String
fn rest_url( &self, endpoint: ServiceEndpoint, model: Option<&GeminiModel>, ) -> String
Build a REST API URL for the given service endpoint and model. Read more
§fn auth_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
GoogleAIAuth: 'async_trait,
fn auth_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
GoogleAIAuth: 'async_trait,
HTTP headers for the WebSocket upgrade request (e.g., Bearer token).
§fn query_params(&self) -> Vec<(String, String)>
fn query_params(&self) -> Vec<(String, String)>
Query parameters to append to the URL (e.g., API key).
Auto Trait Implementations§
impl Freeze for GoogleAIAuth
impl RefUnwindSafe for GoogleAIAuth
impl Send for GoogleAIAuth
impl Sync for GoogleAIAuth
impl Unpin for GoogleAIAuth
impl UnwindSafe for GoogleAIAuth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more