pub struct ReasoningConfig {
pub effort: Option<String>,
pub max_tokens: Option<u32>,
pub exclude: Option<bool>,
}Expand description
Reasoning-tokens configuration.
effort and max_tokens are mutually exclusive on OpenRouter’s side —
setting both yields a 400. Pick the one that matches the constraint you
care about (qualitative effort budget vs. hard token cap).
Fields§
§effort: Option<String>Qualitative effort budget ("low", "medium", "high").
max_tokens: Option<u32>Hard cap on reasoning tokens. Mutually exclusive with effort.
exclude: Option<bool>Ask the provider to omit reasoning content from the response.
Implementations§
Source§impl ReasoningConfig
impl ReasoningConfig
Sourcepub fn with_effort(self, effort: impl Into<String>) -> Self
pub fn with_effort(self, effort: impl Into<String>) -> Self
Set the reasoning effort ("low", "medium", "high").
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Cap the number of reasoning tokens.
Sourcepub fn with_exclude(self, exclude: bool) -> Self
pub fn with_exclude(self, exclude: bool) -> Self
Ask the provider to omit reasoning tokens from the response (counts still appear in usage when supported).
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 moreSource§impl Debug for ReasoningConfig
impl Debug for ReasoningConfig
Source§impl Default for ReasoningConfig
impl Default for ReasoningConfig
Source§fn default() -> ReasoningConfig
fn default() -> ReasoningConfig
Returns the “default value” for a type. Read more
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
Source§impl PartialEq for ReasoningConfig
impl PartialEq for ReasoningConfig
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