pub struct PromptComposer<'a> { /* private fields */ }Expand description
Builder for composing prompts from multiple layers
Implementations§
Source§impl<'a> PromptComposer<'a>
impl<'a> PromptComposer<'a>
Sourcepub fn new(store: &'a PromptStore) -> PromptComposer<'a>
pub fn new(store: &'a PromptStore) -> PromptComposer<'a>
Create a new composer with the given prompt store
Sourcepub fn with_base(self) -> PromptComposer<'a>
pub fn with_base(self) -> PromptComposer<'a>
Add the base system prompt layer
Sourcepub fn with_provider(self, family: ProviderFamily) -> PromptComposer<'a>
pub fn with_provider(self, family: ProviderFamily) -> PromptComposer<'a>
Add a provider-specific prompt layer
Sourcepub fn with_provider_auto(self, model_id: &str) -> PromptComposer<'a>
pub fn with_provider_auto(self, model_id: &str) -> PromptComposer<'a>
Auto-detect provider from model ID and add layer
Sourcepub fn with_verification(self) -> PromptComposer<'a>
pub fn with_verification(self) -> PromptComposer<'a>
Add verification instructions layer
Sourcepub fn with_verification_if(self, enabled: bool) -> PromptComposer<'a>
pub fn with_verification_if(self, enabled: bool) -> PromptComposer<'a>
Conditionally add verification layer
Sourcepub fn with_environment(self, context: EnvironmentContext) -> PromptComposer<'a>
pub fn with_environment(self, context: EnvironmentContext) -> PromptComposer<'a>
Add environment context layer
Sourcepub fn with_current_environment(self) -> PromptComposer<'a>
pub fn with_current_environment(self) -> PromptComposer<'a>
Add current environment context layer
Sourcepub fn with_custom(self, content: impl Into<String>) -> PromptComposer<'a>
pub fn with_custom(self, content: impl Into<String>) -> PromptComposer<'a>
Add a custom prompt section
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PromptComposer<'a>
impl<'a> RefUnwindSafe for PromptComposer<'a>
impl<'a> Send for PromptComposer<'a>
impl<'a> Sync for PromptComposer<'a>
impl<'a> Unpin for PromptComposer<'a>
impl<'a> UnsafeUnpin for PromptComposer<'a>
impl<'a> UnwindSafe for PromptComposer<'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