pub struct Conversation { /* private fields */ }Expand description
The message log the harness owns: system, user, assistant, assistant-tool-calls, tool-response. Never a vendor type.
Implementations§
Source§impl Conversation
impl Conversation
Sourcepub fn with_system(prompt: impl Into<String>) -> Self
pub fn with_system(prompt: impl Into<String>) -> Self
Start a conversation with a system prompt.
Sourcepub fn push_user(&mut self, content: impl Into<String>)
pub fn push_user(&mut self, content: impl Into<String>)
Append a user message (goals, directed corrections).
Sourcepub fn push_tool_calls(&mut self, calls: Vec<ProviderToolCall>)
pub fn push_tool_calls(&mut self, calls: Vec<ProviderToolCall>)
Append an assistant tool-call turn.
Sourcepub fn push_tool_response(
&mut self,
call_id: impl Into<String>,
content: impl Into<String>,
)
pub fn push_tool_response( &mut self, call_id: impl Into<String>, content: impl Into<String>, )
Append one tool response, correlated by call id.
Sourcepub fn estimated_chars(&self) -> usize
pub fn estimated_chars(&self) -> usize
Approximate serialized context size without relying on a provider tokenizer. Runtime thresholds apply a conservative chars-per-token conversion before calling this method.
Sourcepub fn compact_with_control(&mut self, control: impl Into<String>)
pub fn compact_with_control(&mut self, control: impl Into<String>)
Replace closed history with a deterministic control projection while preserving every unresolved provider call exactly. Full closed history remains in the event ledger; this only changes the next model request.
Sourcepub fn unresolved_call_ids(&self) -> Vec<String>
pub fn unresolved_call_ids(&self) -> Vec<String>
Tool calls that have no recorded response yet. A checkpoint must
preserve these exactly (system 14’s ControlFrame).
Trait Implementations§
Source§impl Clone for Conversation
impl Clone for Conversation
Source§fn clone(&self) -> Conversation
fn clone(&self) -> Conversation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Conversation
impl Debug for Conversation
Source§impl Default for Conversation
impl Default for Conversation
Source§fn default() -> Conversation
fn default() -> Conversation
Source§impl<'de> Deserialize<'de> for Conversation
impl<'de> Deserialize<'de> for Conversation
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>,
Source§impl PartialEq for Conversation
impl PartialEq for Conversation
Source§fn eq(&self, other: &Conversation) -> bool
fn eq(&self, other: &Conversation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Conversation
impl Serialize for Conversation
impl StructuralPartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.