pub struct Gemini<'a> { /* private fields */ }Implementations§
Source§impl<'a> Gemini<'a>
impl<'a> Gemini<'a>
Sourcepub fn new(
api_key: String,
model: String,
sys_prompt: Option<SystemInstruction<'a>>,
) -> Self
pub fn new( api_key: String, model: String, sys_prompt: Option<SystemInstruction<'a>>, ) -> Self
sys_prompt should follow gemini doc
Sourcepub fn set_generation_config(&mut self, generation_config: Value) -> &mut Self
pub fn set_generation_config(&mut self, generation_config: Value) -> &mut Self
The generation config Schema should follow Gemini docs
pub fn set_model(&mut self, model: String)
pub fn set_api_key(&mut self, api_key: String)
Sourcepub fn set_json_mode(&mut self, schema: Value) -> &Self
pub fn set_json_mode(&mut self, schema: Value) -> &Self
schema should follow Schema of gemini
pub fn unset_json_mode(&mut self) -> &Self
Sourcepub fn set_tools(&mut self, tools: Option<Vec<Tool>>) -> &Self
pub fn set_tools(&mut self, tools: Option<Vec<Tool>>) -> &Self
toolscan be None to unset tools from using.- Or Vec tools to be allowed
pub fn unset_code_execution_mode(&mut self) -> &Self
pub async fn ask<'b>( &self, session: &'b mut Session, ) -> Result<GeminiResponse, Box<dyn Error>>
pub async fn ask_as_stream<'b>( &self, session: &'b mut Session, ) -> Result<GeminiResponseStream<'b>, Box<dyn Error>>
Auto Trait Implementations§
impl<'a> Freeze for Gemini<'a>
impl<'a> !RefUnwindSafe for Gemini<'a>
impl<'a> !Send for Gemini<'a>
impl<'a> !Sync for Gemini<'a>
impl<'a> Unpin for Gemini<'a>
impl<'a> !UnwindSafe for Gemini<'a>
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