pub struct Context { /* private fields */ }
Implementations§
Source§impl Context
impl Context
pub fn new() -> Self
pub fn push_message(&mut self, role: Role, content: String)
pub fn push_file(&mut self, role: Role, file_data: FileData)
pub fn push_blob(&mut self, role: Role, blob: Blob)
pub fn push_message_with_file( &mut self, role: Role, content: &str, file_data: FileData, )
pub fn push_message_with_blob(&mut self, role: Role, content: &str, blob: Blob)
pub fn build(&self, settings: &Settings) -> GenerateContentRequest
pub fn clear(&mut self)
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn get_contents(&self) -> &Vec<Content>
pub fn get_contents_mut(&mut self) -> &mut Vec<Content>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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