pub enum PromptMessage {
KeyValue {
title: String,
messages: Vec<(String, Arc<dyn Fn() -> String + Send + Sync>)>,
},
Templated(TemplatedMessage),
Simple(String),
}
Variants§
Implementations§
Source§impl PromptMessage
impl PromptMessage
pub fn new_key_value(title: &str) -> Self
pub fn new_templated(templated_msg: TemplatedMessage) -> Self
pub fn new_simple(message: String) -> Self
pub fn add_message(&mut self, key: &str, value: &str)
pub fn add_message_dyn<F>(&mut self, key: &str, value: F)
Trait Implementations§
Source§impl Clone for PromptMessage
impl Clone for PromptMessage
Source§fn clone(&self) -> PromptMessage
fn clone(&self) -> PromptMessage
Returns a copy 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 moreSource§impl Debug for PromptMessage
impl Debug for PromptMessage
Source§impl From<&str> for PromptMessage
impl From<&str> for PromptMessage
Source§impl From<String> for PromptMessage
impl From<String> for PromptMessage
Source§impl From<TemplatedMessage> for PromptMessage
impl From<TemplatedMessage> for PromptMessage
Source§fn from(value: TemplatedMessage) -> Self
fn from(value: TemplatedMessage) -> Self
Converts to this type from the input type.
Source§impl MessageBuilder for PromptMessage
impl MessageBuilder for PromptMessage
Auto Trait Implementations§
impl Freeze for PromptMessage
impl !RefUnwindSafe for PromptMessage
impl Send for PromptMessage
impl Sync for PromptMessage
impl Unpin for PromptMessage
impl !UnwindSafe for PromptMessage
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