pub struct MessageMetadata { /* private fields */ }Expand description
Metadata attached to every message in the conversation history.
Skipped during serialization when None to preserve backward compatibility
with all existing persistence formats (session archives, snapshots, etc.).
Implementations§
Source§impl MessageMetadata
impl MessageMetadata
Sourcepub fn user_input(timestamp: u64, estimated_tokens: usize) -> Self
pub fn user_input(timestamp: u64, estimated_tokens: usize) -> Self
Create metadata for a message originating from a user.
Sourcepub fn llm_response(timestamp: u64, estimated_tokens: usize) -> Self
pub fn llm_response(timestamp: u64, estimated_tokens: usize) -> Self
Create metadata for a message originating from an LLM response.
Sourcepub fn tool_result(timestamp: u64, estimated_tokens: usize) -> Self
pub fn tool_result(timestamp: u64, estimated_tokens: usize) -> Self
Create metadata for a tool result message.
Trait Implementations§
Source§impl Clone for MessageMetadata
impl Clone for MessageMetadata
Source§fn clone(&self) -> MessageMetadata
fn clone(&self) -> MessageMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MessageMetadata
impl Debug for MessageMetadata
Source§impl<'de> Deserialize<'de> for MessageMetadata
impl<'de> Deserialize<'de> for MessageMetadata
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 PartialEq for MessageMetadata
impl PartialEq for MessageMetadata
Source§impl Serialize for MessageMetadata
impl Serialize for MessageMetadata
impl StructuralPartialEq for MessageMetadata
Auto Trait Implementations§
impl Freeze for MessageMetadata
impl RefUnwindSafe for MessageMetadata
impl Send for MessageMetadata
impl Sync for MessageMetadata
impl Unpin for MessageMetadata
impl UnsafeUnpin for MessageMetadata
impl UnwindSafe for MessageMetadata
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