pub struct HumanMessageChunk { /* private fields */ }Expand description
Human message chunk (yielded when streaming).
This corresponds to HumanMessageChunk in LangChain Python.
Implementations§
Source§impl HumanMessageChunk
impl HumanMessageChunk
Sourcepub fn new(content: impl Into<String>) -> Self
pub fn new(content: impl Into<String>) -> Self
Create a new human message chunk with text content.
Sourcepub fn with_id(id: impl Into<String>, content: impl Into<String>) -> Self
pub fn with_id(id: impl Into<String>, content: impl Into<String>) -> Self
Create a new human message chunk with an ID.
Sourcepub fn message_content(&self) -> &MessageContent
pub fn message_content(&self) -> &MessageContent
Get the full message content.
Sourcepub fn additional_kwargs(&self) -> &HashMap<String, Value>
pub fn additional_kwargs(&self) -> &HashMap<String, Value>
Get additional kwargs.
Sourcepub fn response_metadata(&self) -> &HashMap<String, Value>
pub fn response_metadata(&self) -> &HashMap<String, Value>
Get response metadata.
Sourcepub fn concat(&self, other: &HumanMessageChunk) -> HumanMessageChunk
pub fn concat(&self, other: &HumanMessageChunk) -> HumanMessageChunk
Concatenate this chunk with another chunk.
Sourcepub fn to_message(&self) -> HumanMessage
pub fn to_message(&self) -> HumanMessage
Convert this chunk to a complete HumanMessage.
Trait Implementations§
Source§impl Add for HumanMessageChunk
impl Add for HumanMessageChunk
Source§type Output = HumanMessageChunk
type Output = HumanMessageChunk
The resulting type after applying the
+ operator.Source§fn add(self, other: HumanMessageChunk) -> HumanMessageChunk
fn add(self, other: HumanMessageChunk) -> HumanMessageChunk
Performs the
+ operation. Read moreSource§impl Clone for HumanMessageChunk
impl Clone for HumanMessageChunk
Source§fn clone(&self) -> HumanMessageChunk
fn clone(&self) -> HumanMessageChunk
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 HumanMessageChunk
impl Debug for HumanMessageChunk
Source§impl<'de> Deserialize<'de> for HumanMessageChunk
impl<'de> Deserialize<'de> for HumanMessageChunk
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<HumanMessageChunk> for BaseMessageChunk
impl From<HumanMessageChunk> for BaseMessageChunk
Source§fn from(chunk: HumanMessageChunk) -> Self
fn from(chunk: HumanMessageChunk) -> Self
Converts to this type from the input type.
Source§impl PartialEq for HumanMessageChunk
impl PartialEq for HumanMessageChunk
Source§impl Serialize for HumanMessageChunk
impl Serialize for HumanMessageChunk
impl StructuralPartialEq for HumanMessageChunk
Auto Trait Implementations§
impl Freeze for HumanMessageChunk
impl RefUnwindSafe for HumanMessageChunk
impl Send for HumanMessageChunk
impl Sync for HumanMessageChunk
impl Unpin for HumanMessageChunk
impl UnwindSafe for HumanMessageChunk
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