pub struct PromptStore { /* private fields */ }Implementations§
Source§impl PromptStore
impl PromptStore
pub fn create_template( &self, name: &str, template: &str, model_hint: Option<&str>, max_tokens: Option<i64>, metadata: Option<Value>, ) -> Result<String>
Sourcepub fn get_template(&self, name: &str) -> Result<PromptTemplate>
pub fn get_template(&self, name: &str) -> Result<PromptTemplate>
Get the latest version of a named template.
Sourcepub fn get_template_version(
&self,
name: &str,
version: i64,
) -> Result<PromptTemplate>
pub fn get_template_version( &self, name: &str, version: i64, ) -> Result<PromptTemplate>
Get a specific version of a template.
pub fn list_templates(&self) -> Result<Vec<PromptTemplate>>
Sourcepub fn render(
&self,
name: &str,
vars: &HashMap<String, String>,
) -> Result<String>
pub fn render( &self, name: &str, vars: &HashMap<String, String>, ) -> Result<String>
Render a template by substituting {{key}} placeholders with values from vars.
pub fn delete_template(&self, name: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for PromptStore
impl RefUnwindSafe for PromptStore
impl Send for PromptStore
impl Sync for PromptStore
impl Unpin for PromptStore
impl UnsafeUnpin for PromptStore
impl UnwindSafe for PromptStore
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