pub struct Turn {
pub id: String,
pub message: Message,
pub response_parts: Vec<ResponsePart>,
pub usage: Option<UsageInfo>,
pub state: TurnState,
pub error: Option<ErrorInfo>,
}Expand description
A completed request/response cycle.
Fields§
§id: StringTurn identifier
message: MessageThe message that initiated the turn
response_parts: Vec<ResponsePart>All response content in stream order: text, tool calls, reasoning, and content refs.
Consumers should derive display text by concatenating markdown parts,
and find tool calls by filtering for ToolCall parts.
usage: Option<UsageInfo>Token usage info
state: TurnStateHow the turn ended
error: Option<ErrorInfo>Error details if state is 'error'
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Turn
impl<'de> Deserialize<'de> for Turn
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
impl StructuralPartialEq for Turn
Auto Trait Implementations§
impl Freeze for Turn
impl RefUnwindSafe for Turn
impl Send for Turn
impl Sync for Turn
impl Unpin for Turn
impl UnsafeUnpin for Turn
impl UnwindSafe for Turn
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