pub enum ReasoningContent {
Text(String),
Segments(Vec<String>),
}Expand description
Reasoning content from a previous assistant turn.
Deserializes from either:
- A plain string:
"reasoning_content": "thinking..."->Text("thinking...") - An array of strings:
"reasoning_content": ["seg1", "seg2"]->Segments(["seg1", "seg2"])
The Segments variant preserves interleaved reasoning order needed for KV cache-correct
context reconstruction. segments[i] is the reasoning that preceded tool_calls[i];
segments[tool_calls.len()] is any trailing reasoning after the last tool call.
Variants§
Text(String)
Flat string – single reasoning block or legacy backward-compat form.
Segments(Vec<String>)
Interleaved segments. segments[i] precedes tool_calls[i]; segments[N] is trailing reasoning after the last tool call.
Implementations§
Trait Implementations§
Source§impl Clone for ReasoningContent
impl Clone for ReasoningContent
Source§fn clone(&self) -> ReasoningContent
fn clone(&self) -> ReasoningContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ReasoningContent
impl Debug for ReasoningContent
Source§impl<'de> Deserialize<'de> for ReasoningContent
impl<'de> Deserialize<'de> for ReasoningContent
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
Source§impl PartialEq for ReasoningContent
impl PartialEq for ReasoningContent
Source§fn eq(&self, other: &ReasoningContent) -> bool
fn eq(&self, other: &ReasoningContent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ReasoningContent
impl Serialize for ReasoningContent
impl StructuralPartialEq for ReasoningContent
Auto Trait Implementations§
impl Freeze for ReasoningContent
impl RefUnwindSafe for ReasoningContent
impl Send for ReasoningContent
impl Sync for ReasoningContent
impl Unpin for ReasoningContent
impl UnsafeUnpin for ReasoningContent
impl UnwindSafe for ReasoningContent
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