pub struct SessionMeta {
pub title: String,
pub labels: BTreeMap<String, String>,
pub updated: u64,
pub model: String,
pub messages: usize,
pub listed: BTreeMap<String, Value>,
}Expand description
What a listing shows of a session, kept in its store: what it is about, the labels plugins give it, and when it last changed. Its logs hold the same facts; this is the cache a listing reads without folding them. Fields a reader does not know are skipped, and missing ones are empty.
Fields§
§title: StringWhat the session is about: the start of the first message the user
typed (title_of); empty until a turn ended.
labels: BTreeMap<String, String>Plugins’ labels by tag, such as a goal or what it cost.
updated: u64When it last changed, in milliseconds since the Unix epoch.
model: StringThe main agent’s model, vendor/model; empty when unknown.
messages: usizeHow many messages the main agent’s active line holds.
listed: BTreeMap<String, Value>Plugins’ listed values by key, each copied here whenever it changes, so a listing shows and filters by them without opening a log; kept small.
Implementations§
Source§impl SessionMeta
impl SessionMeta
Sourcepub fn read(files: &(impl Files + ?Sized)) -> Option<Self>
pub fn read(files: &(impl Files + ?Sized)) -> Option<Self>
The listing kept in files, if it has one that reads.
Sourcepub fn relist(&mut self, session: &Session, listed: &BTreeSet<String>)
pub fn relist(&mut self, session: &Session, listed: &BTreeSet<String>)
Updates this listing from session, for a program that writes a
session no rig is running: the main agent’s model and message count,
updated set to now, and each listed value (keys in listed, plus
those already listed), taken from the session’s own values, else from
the first agent by main_order that has one. A value that is gone
is unlisted. The title and labels stay.
Trait Implementations§
Source§impl Clone for SessionMeta
impl Clone for SessionMeta
Source§impl Debug for SessionMeta
impl Debug for SessionMeta
Source§impl Default for SessionMeta
impl Default for SessionMeta
Source§impl<'de> Deserialize<'de> for SessionMetawhere
SessionMeta: Default,
impl<'de> Deserialize<'de> for SessionMetawhere
SessionMeta: Default,
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>,
impl Eq for SessionMeta
Source§impl PartialEq for SessionMeta
impl PartialEq for SessionMeta
Source§impl Serialize for SessionMeta
impl Serialize for SessionMeta
impl StructuralPartialEq for SessionMeta
Auto Trait Implementations§
impl Freeze for SessionMeta
impl RefUnwindSafe for SessionMeta
impl Send for SessionMeta
impl Sync for SessionMeta
impl Unpin for SessionMeta
impl UnsafeUnpin for SessionMeta
impl UnwindSafe for SessionMeta
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.