pub struct PromptAssembly { /* private fields */ }Expand description
Assembles a system prompt from ordered sections with caching. Static sections are rendered once and cached; dynamic re-render each time.
Implementations§
Source§impl PromptAssembly
impl PromptAssembly
pub fn new() -> Self
Sourcepub fn add(&mut self, section: impl PromptSection + 'static)
pub fn add(&mut self, section: impl PromptSection + 'static)
Add a section whose stability is determined by its own
PromptSection::stability implementation.
pub async fn build(&self) -> String
Sourcepub async fn build_blocks(&self) -> Vec<PromptBlock>
pub async fn build_blocks(&self) -> Vec<PromptBlock>
Render the assembly into structured blocks.
pub async fn build_stats(&self) -> PromptStats
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PromptAssembly
impl !RefUnwindSafe for PromptAssembly
impl Send for PromptAssembly
impl Sync for PromptAssembly
impl Unpin for PromptAssembly
impl UnsafeUnpin for PromptAssembly
impl !UnwindSafe for PromptAssembly
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