pub struct ConversationView {
pub id: String,
pub started_at: Option<DateTime<Utc>>,
pub last_activity: Option<DateTime<Utc>>,
pub turns: Vec<Turn>,
}Expand description
A complete conversation from any provider.
Fields§
§id: StringUnique session/conversation identifier.
started_at: Option<DateTime<Utc>>When the conversation started.
last_activity: Option<DateTime<Utc>>When the conversation was last active.
turns: Vec<Turn>Ordered turns.
Implementations§
Source§impl ConversationView
impl ConversationView
Sourcepub fn title(&self, max_len: usize) -> Option<String>
pub fn title(&self, max_len: usize) -> Option<String>
Title derived from the first user turn, truncated to max_len characters.
Sourcepub fn turns_by_role(&self, role: &Role) -> Vec<&Turn>
pub fn turns_by_role(&self, role: &Role) -> Vec<&Turn>
All turns with the given role.
Sourcepub fn turns_since(&self, turn_id: &str) -> &[Turn]
pub fn turns_since(&self, turn_id: &str) -> &[Turn]
Turns added after the turn with the given ID.
If the ID is not found, returns all turns. If the ID is the last turn, returns an empty slice.
Trait Implementations§
Source§impl Clone for ConversationView
impl Clone for ConversationView
Source§fn clone(&self) -> ConversationView
fn clone(&self) -> ConversationView
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 ConversationView
impl Debug for ConversationView
Source§impl<'de> Deserialize<'de> for ConversationView
impl<'de> Deserialize<'de> for ConversationView
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
Auto Trait Implementations§
impl Freeze for ConversationView
impl RefUnwindSafe for ConversationView
impl Send for ConversationView
impl Sync for ConversationView
impl Unpin for ConversationView
impl UnsafeUnpin for ConversationView
impl UnwindSafe for ConversationView
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