pub struct Conversation { /* private fields */ }Expand description
One session’s conversation items and state of the current turn.
Implementations§
Source§impl Conversation
impl Conversation
pub fn new() -> Self
pub fn apply_event(&mut self, event: &AcpEvent) -> Option<TurnFinished>
pub fn start_prompt( &mut self, echo: Option<Vec<ContentBlock>>, ) -> Result<(), TurnInProgress>
Sourcepub fn accept_prompt(&mut self)
pub fn accept_prompt(&mut self)
The agent accepted the prompt.
pub fn fail_prompt(&mut self, reason: impl Display)
pub fn clear(&mut self)
pub fn append_user_content( &mut self, content: Vec<ContentBlock>, ) -> ConversationItemId
pub fn append_notice(&mut self, text: impl Into<String>) -> ConversationItemId
pub fn id(&self) -> ConversationId
pub fn revision(&self) -> Revision
pub fn items(&self) -> &[ConversationItem]
pub fn turn(&self) -> TurnPhase
pub fn activity(&self) -> Activity
pub fn plan(&self) -> Option<&PlanItems>
pub fn context_usage(&self) -> Option<&UsageUpdate>
pub fn is_compacting(&self) -> bool
pub fn any_running(&self) -> bool
Trait Implementations§
Source§impl Debug for Conversation
impl Debug for Conversation
Auto Trait Implementations§
impl Freeze 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
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.