pub struct TextPromptClient {
pub name: String,
pub version: i32,
pub template: String,
pub config: Value,
pub labels: Vec<String>,
pub tags: Vec<String>,
pub is_fallback: bool,
}Expand description
A compiled text prompt. Holds the raw template and supports {{variable}} substitution.
Fields§
§name: StringPrompt name.
version: i32Prompt version.
template: StringRaw template string containing {{variable}} placeholders.
config: ValueArbitrary configuration attached to the prompt.
labels: Vec<String>Labels associated with this prompt version (e.g. ["production"]).
Tags for categorisation.
is_fallback: boolWhether this prompt was served from an expired cache entry (fallback).
Implementations§
Source§impl TextPromptClient
impl TextPromptClient
Sourcepub fn compile(
&self,
variables: &HashMap<String, String>,
) -> Result<String, LangfuseError>
pub fn compile( &self, variables: &HashMap<String, String>, ) -> Result<String, LangfuseError>
Compile the prompt by replacing {{variable}} placeholders with values from variables.
Returns LangfuseError::PromptCompilation if a placeholder references a variable
that is not present in the map.
Trait Implementations§
Source§impl Clone for TextPromptClient
impl Clone for TextPromptClient
Source§fn clone(&self) -> TextPromptClient
fn clone(&self) -> TextPromptClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextPromptClient
impl RefUnwindSafe for TextPromptClient
impl Send for TextPromptClient
impl Sync for TextPromptClient
impl Unpin for TextPromptClient
impl UnsafeUnpin for TextPromptClient
impl UnwindSafe for TextPromptClient
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