pub struct SystemMessageChunk { /* private fields */ }Expand description
System message chunk (yielded when streaming).
This corresponds to SystemMessageChunk in LangChain Python.
Implementations§
Source§impl SystemMessageChunk
impl SystemMessageChunk
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 system message chunk with an ID.
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: &SystemMessageChunk) -> SystemMessageChunk
pub fn concat(&self, other: &SystemMessageChunk) -> SystemMessageChunk
Concatenate this chunk with another chunk.
Sourcepub fn to_message(&self) -> SystemMessage
pub fn to_message(&self) -> SystemMessage
Convert this chunk to a complete SystemMessage.
Trait Implementations§
Source§impl Add for SystemMessageChunk
impl Add for SystemMessageChunk
Source§type Output = SystemMessageChunk
type Output = SystemMessageChunk
The resulting type after applying the
+ operator.Source§fn add(self, other: SystemMessageChunk) -> SystemMessageChunk
fn add(self, other: SystemMessageChunk) -> SystemMessageChunk
Performs the
+ operation. Read moreSource§impl Clone for SystemMessageChunk
impl Clone for SystemMessageChunk
Source§fn clone(&self) -> SystemMessageChunk
fn clone(&self) -> SystemMessageChunk
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 SystemMessageChunk
impl Debug for SystemMessageChunk
Source§impl<'de> Deserialize<'de> for SystemMessageChunk
impl<'de> Deserialize<'de> for SystemMessageChunk
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<SystemMessageChunk> for BaseMessageChunk
impl From<SystemMessageChunk> for BaseMessageChunk
Source§fn from(chunk: SystemMessageChunk) -> Self
fn from(chunk: SystemMessageChunk) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SystemMessageChunk
impl PartialEq for SystemMessageChunk
Source§impl Serialize for SystemMessageChunk
impl Serialize for SystemMessageChunk
impl StructuralPartialEq for SystemMessageChunk
Auto Trait Implementations§
impl Freeze for SystemMessageChunk
impl RefUnwindSafe for SystemMessageChunk
impl Send for SystemMessageChunk
impl Sync for SystemMessageChunk
impl Unpin for SystemMessageChunk
impl UnwindSafe for SystemMessageChunk
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