The only owner of the conversation history.
Inputs:
Transcriptionwith a newturn_id- a user turn: the history gets it (after itsannotation, if any, labelled[speaker]when it has one) and anLLMContextgoes downstream, unless it hasrespond: falseUserAudio- a user turn heard as audio (half-cascaded); its conversation item is reserved until the transcript arrivesTranscriptionfor an audio turn - replaces that turn's audio with text, so later requests don't resend itToolResults(upstream) - the next tool round, up tomax_tool_rounds; after that the LLM answers without toolsAssistantMessage(upstream) - the reply, finished or interrupted. It comes once its audio has played, so it takes the place in the history that its turn reserved: turns heard while it played come after it. An interrupted reply holds only what was heard, and ends in… [interrupted]so the LLM knows it was cut off.AsyncToolResult(upstream) - a non-blocking tool's result: noted silently, or a new turn about itPrompt- a turn from the app (Octoroom.Agent.prompt/3), marked as not said by anyone on the callStart- afterinitial_delay_ms, the agent'sinitial_textstarts a turn
It also emits the owner's conversation events (Octoroom.Agent.ConversationEvents),
and sends the owner {:voice_pipeline, pid, {:memory, memory}} whenever
what's worth keeping changes: %{history: messages, conversation: %{id, sequence}}, the history without replies still to come or turns still
audio. The worker saves it, and a context started with saved: (in its
runner context) carries on from it.
Options (each defaults to the runner context's value): :instructions,
:initial_text, :tools; plus :max_tool_rounds (4), :max_history (20),
:initial_delay_ms (100).