pub enum BaseMessage {
Human(HumanMessage),
System(SystemMessage),
AI(AIMessage),
Tool(ToolMessage),
}Expand description
A unified message type that can represent any message role.
Variants§
Human(HumanMessage)
A human message
System(SystemMessage)
A system message
AI(AIMessage)
An AI message
Tool(ToolMessage)
A tool result message
Implementations§
Source§impl BaseMessage
impl BaseMessage
Source§impl BaseMessage
impl BaseMessage
Sourcepub fn pretty_print(&self)
pub fn pretty_print(&self)
Pretty print the message to stdout. This mimics LangChain’s pretty_print() method for messages.
Trait Implementations§
Source§impl Clone for BaseMessage
impl Clone for BaseMessage
Source§fn clone(&self) -> BaseMessage
fn clone(&self) -> BaseMessage
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 moreSource§impl Debug for BaseMessage
impl Debug for BaseMessage
Source§impl<'de> Deserialize<'de> for BaseMessage
impl<'de> Deserialize<'de> for BaseMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AIMessage> for BaseMessage
impl From<AIMessage> for BaseMessage
Source§impl From<HumanMessage> for BaseMessage
impl From<HumanMessage> for BaseMessage
Source§fn from(msg: HumanMessage) -> Self
fn from(msg: HumanMessage) -> Self
Converts to this type from the input type.
Source§impl From<SystemMessage> for BaseMessage
impl From<SystemMessage> for BaseMessage
Source§fn from(msg: SystemMessage) -> Self
fn from(msg: SystemMessage) -> Self
Converts to this type from the input type.
Source§impl From<ToolMessage> for BaseMessage
impl From<ToolMessage> for BaseMessage
Source§fn from(msg: ToolMessage) -> Self
fn from(msg: ToolMessage) -> Self
Converts to this type from the input type.
Source§impl PartialEq for BaseMessage
impl PartialEq for BaseMessage
Source§impl Serialize for BaseMessage
impl Serialize for BaseMessage
impl StructuralPartialEq for BaseMessage
Auto Trait Implementations§
impl Freeze for BaseMessage
impl RefUnwindSafe for BaseMessage
impl Send for BaseMessage
impl Sync for BaseMessage
impl Unpin for BaseMessage
impl UnwindSafe for BaseMessage
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