pub struct ConversationDigest {
pub header: SessionHeader,
pub messages_len: usize,
pub messages_hash: u64,
pub tokens: ConversationTokens,
pub cost: f64,
pub keepwarm_cost: f64,
pub keepwarm_tokens: ConversationTokens,
pub abort_context: Option<String>,
pub queued_message: Option<String>,
pub pending_events_len: usize,
pub consecutive_auto_turns: u32,
}Expand description
ConversationSnapshot minus api_messages: what Conversation carries
on the wire. messages_hash is FNV-1a over each message’s JSON so a
client can tell whether its local mirror is current.
Fields§
§header: SessionHeader§messages_len: usize§messages_hash: u64§tokens: ConversationTokens§cost: f64§keepwarm_cost: f64§keepwarm_tokens: ConversationTokens§abort_context: Option<String>§queued_message: Option<String>§pending_events_len: usize§consecutive_auto_turns: u32Implementations§
Source§impl ConversationDigest
impl ConversationDigest
pub fn of(s: &ConversationSnapshot) -> Self
pub fn matches(&self, messages: &[SharedMessage]) -> bool
Sourcepub fn into_snapshot(
self,
api_messages: Vec<SharedMessage>,
) -> ConversationSnapshot
pub fn into_snapshot( self, api_messages: Vec<SharedMessage>, ) -> ConversationSnapshot
Rebuild a snapshot around messages (the caller’s mirror).
Trait Implementations§
Source§impl Clone for ConversationDigest
impl Clone for ConversationDigest
Source§impl Debug for ConversationDigest
impl Debug for ConversationDigest
Source§impl<'de> Deserialize<'de> for ConversationDigest
impl<'de> Deserialize<'de> for ConversationDigest
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 ConversationDigest
impl PartialEq for ConversationDigest
Source§impl Serialize for ConversationDigest
impl Serialize for ConversationDigest
impl StructuralPartialEq for ConversationDigest
Auto Trait Implementations§
impl Freeze for ConversationDigest
impl RefUnwindSafe for ConversationDigest
impl Send for ConversationDigest
impl Sync for ConversationDigest
impl Unpin for ConversationDigest
impl UnsafeUnpin for ConversationDigest
impl UnwindSafe for ConversationDigest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.