pub enum ReasoningPolicy {
Include,
Exclude,
}Expand description
Per-provider strategy for echoing back reasoning_content from historical
assistant tool_call messages on subsequent requests.
Different thinking-model APIs contradict each other:
- Moonshot Kimi K2-thinking / K2.5 / K2.6 — MUST echo reasoning_content on every assistant tool_call message in history; otherwise returns 400 with “thinking is enabled but reasoning_content is missing in assistant tool call message at index N”.
- DeepSeek-R1 / deepseek-reasoner (V3 family) — MUST NOT include reasoning_content in subsequent requests; returns 400 if present.
- DeepSeek V4 family (
deepseek-v4*, thinking mode) — opposite of V3: MUST echo reasoning_content on every assistant tool_call message, or the API returns 400 “Thereasoning_contentin the thinking mode must be passed back to the API”. - MiniMax-M2 (default) — thinking is embedded in content as
<think>...</think>, goes through the plain-text path; no separate field handling needed. - Anthropic — uses a different
thinkingblock structure in its own messages format; not affected by this policy.
Variants§
Include
Echo the stored reasoning_content back on every assistant tool_call message. When the stored value is None, emit an empty string so the field is always present (some providers treat a missing field as “field absent” and error out even with empty content).
Exclude
Strip reasoning_content — never emit the field in outbound requests, even if we captured it from the stream. This is the safe default.
Trait Implementations§
Source§impl Clone for ReasoningPolicy
impl Clone for ReasoningPolicy
Source§fn clone(&self) -> ReasoningPolicy
fn clone(&self) -> ReasoningPolicy
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 ReasoningPolicy
impl Debug for ReasoningPolicy
Source§impl PartialEq for ReasoningPolicy
impl PartialEq for ReasoningPolicy
Source§fn eq(&self, other: &ReasoningPolicy) -> bool
fn eq(&self, other: &ReasoningPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ReasoningPolicy
impl Eq for ReasoningPolicy
impl StructuralPartialEq for ReasoningPolicy
Auto Trait Implementations§
impl Freeze for ReasoningPolicy
impl RefUnwindSafe for ReasoningPolicy
impl Send for ReasoningPolicy
impl Sync for ReasoningPolicy
impl Unpin for ReasoningPolicy
impl UnsafeUnpin for ReasoningPolicy
impl UnwindSafe for ReasoningPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
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>
Converts
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>
Converts
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