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