pub enum TurnStatus {
Continue {
content: String,
usage: TurnUsage,
},
Done {
content: String,
usage: TurnUsage,
},
ToolCalls {
content: String,
tool_calls: Vec<ToolCall>,
usage: TurnUsage,
},
Interrupted {
tool_call_id: String,
tool_name: String,
output: String,
payload: Option<Arc<dyn InterruptPayload>>,
content: String,
usage: TurnUsage,
},
CompactionNeeded {
content: String,
usage: TurnUsage,
reason: CompactionReason,
},
}Expand description
Result of a single agent turn after the LLM has responded.
Variants§
Continue
No tool calls but the turn should continue (e.g. empty response retry).
Done
No tool calls and no more content expected — this session turn is done.
ToolCalls
The LLM returned tool calls — caller is responsible for executing them.
Interrupted
A tool requested interactive user input. The agent loop has stopped;
the caller should collect the response, add a ConversationEntry::tool
with the result, and resume with AgentInput::Resume.
Fields
§
payload: Option<Arc<dyn InterruptPayload>>CompactionNeeded
The conversation needs compaction before continuing.
Implementations§
Source§impl TurnStatus
impl TurnStatus
Sourcepub fn content_and_usage(&self) -> (&str, &TurnUsage)
pub fn content_and_usage(&self) -> (&str, &TurnUsage)
Extract the content and usage from this turn status, if available.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TurnStatus
impl !UnwindSafe for TurnStatus
impl Forget for TurnStatus
impl Freeze for TurnStatus
impl Move for TurnStatus
impl Send for TurnStatus
impl Sync for TurnStatus
impl Unpin for TurnStatus
impl UnsafeUnpin for TurnStatus
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