pub struct TemplateLibrary { /* private fields */ }Expand description
Template library for common prompt patterns
Implementations§
Source§impl TemplateLibrary
impl TemplateLibrary
Sourcepub fn add(&mut self, name: String, template: PromptTemplate)
pub fn add(&mut self, name: String, template: PromptTemplate)
Add a template to the library
Sourcepub fn get(&self, name: &str) -> Option<&PromptTemplate>
pub fn get(&self, name: &str) -> Option<&PromptTemplate>
Get a template by name
Sourcepub fn remove(&mut self, name: &str) -> Option<PromptTemplate>
pub fn remove(&mut self, name: &str) -> Option<PromptTemplate>
Remove a template by name
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemplateLibrary
impl RefUnwindSafe for TemplateLibrary
impl Send for TemplateLibrary
impl Sync for TemplateLibrary
impl Unpin for TemplateLibrary
impl UnwindSafe for TemplateLibrary
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