pub enum ReasoningExtraction {
None,
DeltaContentField(&'static str),
InlineThinkTags,
}Expand description
Where reasoning content shows up in a streaming response delta.
Variants§
None
Provider doesn’t stream reasoning content (OpenAI Chat Completions for o-series — encrypted server-side).
DeltaContentField(&'static str)
Reasoning arrives in delta.<field> of every streaming chunk.
Common values: "reasoning_content" (vLLM, DeepInfra, DeepSeek)
and "reasoning" (Groq parsed mode, OpenRouter).
InlineThinkTags
Reasoning is <think>...</think> inline in delta.content.
Together-R1, Groq raw mode, Fireworks /think suffix all do this.
Adapter strips tags and reroutes inside-tag bytes to the
reasoning channel via a streaming state machine.
Implementations§
Source§impl ReasoningExtraction
impl ReasoningExtraction
Sourcepub fn parse_delta(&self, delta: &Value) -> Option<ReasoningChunk>
pub fn parse_delta(&self, delta: &Value) -> Option<ReasoningChunk>
Pull reasoning content out of a streaming delta JSON. Returns
None if this strategy doesn’t extract from the JSON body
(None and InlineThinkTags) or if the delta has no reasoning.
InlineThinkTags is handled separately at the byte-stream level
in the adapter; this method returns None for it.
Trait Implementations§
Source§impl Clone for ReasoningExtraction
impl Clone for ReasoningExtraction
Source§fn clone(&self) -> ReasoningExtraction
fn clone(&self) -> ReasoningExtraction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReasoningExtraction
impl Debug for ReasoningExtraction
impl Eq for ReasoningExtraction
Source§impl PartialEq for ReasoningExtraction
impl PartialEq for ReasoningExtraction
impl StructuralPartialEq for ReasoningExtraction
Auto Trait Implementations§
impl Freeze for ReasoningExtraction
impl RefUnwindSafe for ReasoningExtraction
impl Send for ReasoningExtraction
impl Sync for ReasoningExtraction
impl Unpin for ReasoningExtraction
impl UnsafeUnpin for ReasoningExtraction
impl UnwindSafe for ReasoningExtraction
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more