pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(api_key: String, model: String) -> Self
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
Get current client configuration
Sourcepub fn with_retry_config(self, retry_config: RetryConfig) -> Self
pub fn with_retry_config(self, retry_config: RetryConfig) -> Self
Set retry configuration
Sourcepub fn retry_config(&self) -> &RetryConfig
pub fn retry_config(&self) -> &RetryConfig
Get current retry configuration
Sourcepub fn metrics(&self) -> &StreamingMetrics
pub fn metrics(&self) -> &StreamingMetrics
Get streaming metrics
Sourcepub fn reset_metrics(&mut self)
pub fn reset_metrics(&mut self)
Reset streaming metrics
Sourcepub async fn generate(
&mut self,
request: &GenerateContentRequest,
) -> Result<GenerateContentResponse>
pub async fn generate( &mut self, request: &GenerateContentRequest, ) -> Result<GenerateContentResponse>
Generate content with the Gemini API
Sourcepub async fn generate_stream<F>(
&mut self,
request: &GenerateContentRequest,
on_chunk: F,
) -> Result<StreamingResponse, StreamingError>
pub async fn generate_stream<F>( &mut self, request: &GenerateContentRequest, on_chunk: F, ) -> Result<StreamingResponse, StreamingError>
Generate content with the Gemini API using streaming
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Forget for Client
impl Freeze for Clientwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<ClientRef> is !null: Freeze,
PhantomData<ArcInner<ClientRef>>: Freeze,
PhantomData<String>: Freeze,
impl Move for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Clientwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<ClientRef> is !null: UnsafeUnpin,
PhantomData<ArcInner<ClientRef>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.