pub struct GoogleProvider { /* private fields */ }Expand description
Google Gemini provider implementation
Implementations§
Source§impl GoogleProvider
impl GoogleProvider
Sourcepub fn new(api_key: String) -> Result<Self, ProviderError>
pub fn new(api_key: String) -> Result<Self, ProviderError>
Create a new Google provider instance
Sourcepub fn with_base_url(
api_key: String,
base_url: String,
) -> Result<Self, ProviderError>
pub fn with_base_url( api_key: String, base_url: String, ) -> Result<Self, ProviderError>
Create a new Google provider with a custom base URL
Trait Implementations§
Source§impl Provider for GoogleProvider
impl Provider for GoogleProvider
Source§fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a chat completion request
Source§fn chat_stream<'life0, 'async_trait>(
&'life0 self,
_request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat_stream<'life0, 'async_trait>(
&'life0 self,
_request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream a chat completion response
Source§fn count_tokens(
&self,
content: &str,
model: &str,
) -> Result<usize, ProviderError>
fn count_tokens( &self, content: &str, model: &str, ) -> Result<usize, ProviderError>
Count tokens for content
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the provider is available and healthy
Auto Trait Implementations§
impl Freeze for GoogleProvider
impl !RefUnwindSafe for GoogleProvider
impl Send for GoogleProvider
impl Sync for GoogleProvider
impl Unpin for GoogleProvider
impl !UnwindSafe for GoogleProvider
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