Struct anchor_chain::nodes::prompt::Prompt   
source · pub struct Prompt<'a> { /* private fields */ }Expand description
A processor for handling text prompts within a processing chain.
The Prompt struct is a processor for handling text prompts within a
processing chain using Tera templating.
Implementations§
source§impl<'a> Prompt<'a>
 
impl<'a> Prompt<'a>
sourcepub fn new(template: &str) -> Self
 
pub fn new(template: &str) -> Self
Creates a new Prompt processor with the specified template.
Templates need to be specified using the Tera syntax which is based on Jinja2. For more information on Tera, see the Tera Templates documentation.
§Examples
use anchor_chain::nodes::prompt::Prompt;
let prompt = Prompt::new("Create a {{ language }} program that prints 'Hello, World!'");Trait Implementations§
impl<'a> Stateless for Prompt<'a>
Auto Trait Implementations§
impl<'a> Freeze for Prompt<'a>
impl<'a> !RefUnwindSafe for Prompt<'a>
impl<'a> Send for Prompt<'a>
impl<'a> Sync for Prompt<'a>
impl<'a> Unpin for Prompt<'a>
impl<'a> !UnwindSafe for Prompt<'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