pub struct AssistantTurn {
pub turn_index: u32,
pub span_id: SpanId,
pub message: Message,
pub tool_calls: Vec<ToolCall>,
pub usage: Usage,
pub stop_reason: StopReason,
}Expand description
A single completed assistant turn as the loop hands it off to a critic or
captures it for reflexion. Distinct from Message::Assistant because it
bundles the turn metadata the critic and loop consumers both need —
turn index, span id tying to llm.request / llm.response events,
parsed tool calls, token usage, and the stop reason.
Fields§
§turn_index: u32§span_id: SpanId§message: MessageAlways Message::Assistant { .. }.
tool_calls: Vec<ToolCall>§usage: Usage§stop_reason: StopReasonImplementations§
Source§impl AssistantTurn
impl AssistantTurn
Sourcepub fn new(
turn_index: u32,
span_id: impl Into<SpanId>,
message: Message,
usage: Usage,
stop_reason: StopReason,
) -> Self
pub fn new( turn_index: u32, span_id: impl Into<SpanId>, message: Message, usage: Usage, stop_reason: StopReason, ) -> Self
Build from an already-assembled assistant message. span_id ties the
turn to its llm.request / llm.response events; the loop produces
one per turn via RequestTracer’s llm-<N> span.
Trait Implementations§
Source§impl Clone for AssistantTurn
impl Clone for AssistantTurn
Source§fn clone(&self) -> AssistantTurn
fn clone(&self) -> AssistantTurn
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AssistantTurn
impl Debug for AssistantTurn
Source§impl<'de> Deserialize<'de> for AssistantTurn
impl<'de> Deserialize<'de> for AssistantTurn
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AssistantTurn
impl RefUnwindSafe for AssistantTurn
impl Send for AssistantTurn
impl Sync for AssistantTurn
impl Unpin for AssistantTurn
impl UnsafeUnpin for AssistantTurn
impl UnwindSafe for AssistantTurn
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