pub enum ThinkingMode {
Auto,
On,
Off,
}Expand description
Qwen3 hybrid thinking control. Qwen3 models were trained with both a
“thinking” (chain-of-thought inside <think>...</think>) and a
non-thinking mode. Upstream defaults thinking ON; /no_think and
/think are the documented per-turn overrides in the chat template.
Scope: applies to the single-turn local Qwen3 path driven by
apply_chat_template. The multi-turn messages: Vec<Message>
field on GenerateRequest is consumed by remote protocol
handlers (OpenAI/Anthropic/Google) which pass through user-supplied
system messages verbatim; this flag is not injected there. If you
need Qwen3 thinking control over a remote API, include /think or
/no_think explicitly in your own system message.
Variants§
Auto
Let the model decide. No explicit /think or /no_think directive
is injected into the system prompt, so Qwen3’s trained default
(thinking ON) applies. <think>...</think> output is stripped
from the returned text.
On
Inject /think into the system prompt to explicitly request the
thinking phase. Useful when callers want to force reasoning even
on short prompts the model would normally answer directly.
Off
Inject /no_think into the system prompt to suppress the
thinking phase for faster, more direct responses. This was the
prior hard-coded behavior; callers now opt into it explicitly.
Implementations§
Trait Implementations§
Source§impl Clone for ThinkingMode
impl Clone for ThinkingMode
Source§fn clone(&self) -> ThinkingMode
fn clone(&self) -> ThinkingMode
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 ThinkingMode
impl Debug for ThinkingMode
Source§impl Default for ThinkingMode
impl Default for ThinkingMode
Source§fn default() -> ThinkingMode
fn default() -> ThinkingMode
Source§impl<'de> Deserialize<'de> for ThinkingMode
impl<'de> Deserialize<'de> for ThinkingMode
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>,
Source§impl PartialEq for ThinkingMode
impl PartialEq for ThinkingMode
Source§fn eq(&self, other: &ThinkingMode) -> bool
fn eq(&self, other: &ThinkingMode) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ThinkingMode
impl Serialize for ThinkingMode
impl Copy for ThinkingMode
impl Eq for ThinkingMode
impl StructuralPartialEq for ThinkingMode
Auto Trait Implementations§
impl Freeze for ThinkingMode
impl RefUnwindSafe for ThinkingMode
impl Send for ThinkingMode
impl Sync for ThinkingMode
impl Unpin for ThinkingMode
impl UnsafeUnpin for ThinkingMode
impl UnwindSafe for ThinkingMode
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
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§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