pub enum ReasoningConfig {
Disabled,
Low,
Medium,
High,
}Expand description
推理配置 — 声明式控制模型的深度推理行为。
四值语义(Option + Enum):
None(未设置)= 不干预,Provider 自行决定默认行为Some(Disabled)= 显式关闭推理(尽最大努力)Some(Low)= 低推理预算(快速、轻量)Some(Medium)= 中等推理预算Some(High)= 高推理预算(深度思考)
Adapter 映射示例:
- OpenAI / NVIDIA / vLLM:
Disabled→ 不插字段;Low→ “low”;Medium→ “medium”;High→ “high” - DeepSeek:
Disabled→enable_thinking=false;其余 →reasoning_effort=<level> - llama.cpp:
Disabled→thinking=false;其余 →reasoning_effort=<level> - Anthropic:
Disabled→ 静默忽略(不支持推理配置);其余 →UnsupportedFeature - 不支持推理的 Provider:
Disabled→ 静默忽略;其余 →UnsupportedFeature
Variants§
Implementations§
Source§impl ReasoningConfig
impl ReasoningConfig
Sourcepub fn is_disabled(self) -> bool
pub fn is_disabled(self) -> bool
判断是否为 Disabled
Trait Implementations§
Source§impl Clone for ReasoningConfig
impl Clone for ReasoningConfig
Source§fn clone(&self) -> ReasoningConfig
fn clone(&self) -> ReasoningConfig
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 moreimpl Copy for ReasoningConfig
Source§impl Debug for ReasoningConfig
impl Debug for ReasoningConfig
Source§impl<'de> Deserialize<'de> for ReasoningConfig
impl<'de> Deserialize<'de> for ReasoningConfig
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
impl Eq for ReasoningConfig
Source§impl PartialEq for ReasoningConfig
impl PartialEq for ReasoningConfig
Source§fn eq(&self, other: &ReasoningConfig) -> bool
fn eq(&self, other: &ReasoningConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ReasoningConfig
impl Serialize for ReasoningConfig
impl StructuralPartialEq for ReasoningConfig
Auto Trait Implementations§
impl Freeze for ReasoningConfig
impl RefUnwindSafe for ReasoningConfig
impl Send for ReasoningConfig
impl Sync for ReasoningConfig
impl Unpin for ReasoningConfig
impl UnsafeUnpin for ReasoningConfig
impl UnwindSafe for ReasoningConfig
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