pub struct ChatPromptClient {
pub name: String,
pub version: i32,
pub messages: Vec<ChatMessage>,
pub config: Value,
pub labels: Vec<String>,
pub tags: Vec<String>,
pub is_fallback: bool,
}Expand description
A compiled chat prompt. Holds a list of messages with {{variable}} support.
Fields§
§name: StringPrompt name.
version: i32Prompt version.
messages: Vec<ChatMessage>Chat messages, each potentially containing {{variable}} placeholders in content.
config: ValueArbitrary configuration attached to the prompt.
labels: Vec<String>Labels associated with this prompt version.
Tags for categorisation.
is_fallback: boolWhether this prompt was served from an expired cache entry (fallback).
Implementations§
Source§impl ChatPromptClient
impl ChatPromptClient
Sourcepub fn compile(
&self,
variables: &HashMap<String, String>,
) -> Result<Vec<ChatMessage>, LangfuseError>
pub fn compile( &self, variables: &HashMap<String, String>, ) -> Result<Vec<ChatMessage>, LangfuseError>
Compile all messages by replacing {{variable}} placeholders in each message’s content.
Returns LangfuseError::PromptCompilation if any message references a variable
that is not present in the map.
Trait Implementations§
Source§impl Clone for ChatPromptClient
impl Clone for ChatPromptClient
Source§fn clone(&self) -> ChatPromptClient
fn clone(&self) -> ChatPromptClient
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 ChatPromptClient
impl RefUnwindSafe for ChatPromptClient
impl Send for ChatPromptClient
impl Sync for ChatPromptClient
impl Unpin for ChatPromptClient
impl UnsafeUnpin for ChatPromptClient
impl UnwindSafe for ChatPromptClient
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