pub struct PromptManager { /* private fields */ }Expand description
Prompt manager handles prompt rendering with template interpolation
Implementations§
Source§impl PromptManager
impl PromptManager
pub fn new() -> Self
Sourcepub fn render(
&self,
name: &str,
args: FxHashMap<String, Value>,
) -> Result<String>
pub fn render( &self, name: &str, args: FxHashMap<String, Value>, ) -> Result<String>
Render a prompt with given arguments
Sourcepub fn get_prompt(&self, name: &str) -> Option<PromptMetadata>
pub fn get_prompt(&self, name: &str) -> Option<PromptMetadata>
Get prompt metadata
Sourcepub fn list_prompts(&self) -> Vec<String>
pub fn list_prompts(&self) -> Vec<String>
List all registered prompts
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PromptManager
impl RefUnwindSafe for PromptManager
impl Send for PromptManager
impl Sync for PromptManager
impl Unpin for PromptManager
impl UnwindSafe for PromptManager
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