pub struct PromptTemplate { /* private fields */ }Implementations§
Source§impl PromptTemplate
impl PromptTemplate
pub fn new(template: impl Into<String>) -> Self
Sourcepub fn with_partial(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_partial( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Set a partial variable that will be used as a default during rendering. Provided values at render time take precedence over partial variables.
pub fn render( &self, values: &HashMap<String, String>, ) -> Result<String, PromptError>
Trait Implementations§
Source§impl Clone for PromptTemplate
impl Clone for PromptTemplate
Source§fn clone(&self) -> PromptTemplate
fn clone(&self) -> PromptTemplate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptTemplate
impl Debug for PromptTemplate
Source§impl PartialEq for PromptTemplate
impl PartialEq for PromptTemplate
impl Eq for PromptTemplate
impl StructuralPartialEq for PromptTemplate
Auto Trait Implementations§
impl Freeze for PromptTemplate
impl RefUnwindSafe for PromptTemplate
impl Send for PromptTemplate
impl Sync for PromptTemplate
impl Unpin for PromptTemplate
impl UnsafeUnpin for PromptTemplate
impl UnwindSafe for PromptTemplate
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