pub struct Conversation { /* private fields */ }Expand description
The run’s conversation history, owned by the executor and folded forward turn by turn. Frozen-prefix bytes never live here — the conversation is the volatile half of the request.
Implementations§
Source§impl Conversation
impl Conversation
pub fn new() -> Conversation
Sourcepub fn push_task_lines(
&mut self,
task: &str,
goal: &str,
opening: Opening,
from: &str,
)
pub fn push_task_lines( &mut self, task: &str, goal: &str, opening: Opening, from: &str, )
The dispatch lines: deterministic from run_started’s recorded
inputs, hence rebuildable.
The job file’s text is the run segment of the frozen prefix, so the assigned opening names it rather than repeating it: the run segment is not cached, and a pasted task written here again would be paid for twice on every turn.
Sourcepub fn push_steer(&mut self, speaker: &Speaker, text: &str)
pub fn push_steer(&mut self, speaker: &Speaker, text: &str)
Steer joins the tail of the open user message, or opens one. A steer that arrives after that message was sent is held until the next tool results, and rides after them.
The one place a steer is rendered: the User’s as user: <text>, a
resident’s inside one <letter> its body cannot close
(crates/runtime/spec/Conversation.lean §8-47-2).
Sourcepub fn push_reminder(&mut self, reminder: &ContextReminder)
pub fn push_reminder(&mut self, reminder: &ContextReminder)
The context reminder takes the same door as a steer, so it lands where a steer lands: at the end of the tool results the model reads next.
Sourcepub fn push_inherited(&mut self, messages: &[ChatMessage])
pub fn push_inherited(&mut self, messages: &[ChatMessage])
What a branch starts from: the messages the mother exchanged, in the order she exchanged them.
Verbatim, and that is not laziness. The list being pushed was folded through this same type, one turn at a time, so it already satisfies the invariant below; re-deciding here whether its last message may join the next would be a second answer to a rule this module owns. The caller pushes the new run’s own lines afterwards, and those do join.
pub fn push_assistant(&mut self, content: Vec<ContentBlock>)
Sourcepub fn push_tool_results(&mut self, results: Vec<ContentBlock>)
pub fn push_tool_results(&mut self, results: Vec<ContentBlock>)
Tool results join the last user message, or open the next one, and the text held since the last assembly follows them.
Results never wait in held: a reply with no content pushes no
assistant message, so the last user message may already be sent,
and holding the results there would hold them at every turn. The
message they extend is open again, so a steer before the next
assembly joins it after them.
Sourcepub fn mark_sent(&mut self)
pub fn mark_sent(&mut self)
Everything in messages() is now on the wire: later user text
joins none of it.