pub struct Conversation(/* private fields */);Expand description
A conversation: its messages, steps, and usage. It is saved as the JSON the
session database keeps (state_json, the format agent86 and Python’s agent86
share), so a saved conversation opens in either.
Conversation::default is a new conversation with a fresh id.
Implementations§
Source§impl Conversation
impl Conversation
Sourcepub fn messages(&self) -> Vec<ConversationMessage>
pub fn messages(&self) -> Vec<ConversationMessage>
Its messages, oldest first (the system prompt is not one of them).
Sourcepub fn last_turn(&self) -> Option<&TurnSummary>
pub fn last_turn(&self) -> Option<&TurnSummary>
The last turn’s summary, or None before the first.
Trait Implementations§
Source§impl Clone for Conversation
impl Clone for Conversation
Source§impl Debug for Conversation
impl Debug for Conversation
Source§impl Default for Conversation
impl Default for Conversation
Source§impl PartialEq for Conversation
impl PartialEq for Conversation
impl StructuralPartialEq for Conversation
Auto Trait Implementations§
impl Forget for Conversation
impl Freeze for Conversation
impl Move for Conversation
impl RefUnwindSafe for Conversation
impl Send for Conversation
impl Sync for Conversation
impl Unpin for Conversation
impl UnsafeUnpin for Conversation
impl UnwindSafe for Conversation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more