#[non_exhaustive]pub enum Turn {
User {
content: Vec<ContentPart>,
},
Assistant {
content: Vec<ContentPart>,
tools: Vec<ToolPair>,
},
}Expand description
One turn in a compacted conversation. Sealed so a Turn::Assistant
can only carry ToolPairs constructed via the compactor’s
internal grouping code (paired calls + results).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
User
User-authored message — opaque content, never paired.
Fields
§
content: Vec<ContentPart>Multi-part content (text, image, …).
Assistant
Assistant-authored message + the tool round-trips it
initiated. Empty tools means the assistant turn produced
final text only.
Fields
§
content: Vec<ContentPart>Assistant’s content (may include ContentPart::ToolUse
blocks; the embedded tool-use ids match the
corresponding ToolPair::ids).
Trait Implementations§
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