pub struct SamplingOverrides {
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub max_tokens: Option<u32>,
pub reasoning_effort: Option<ReasoningEffortLevel>,
pub suppresses_sampling_with_reasoning: bool,
pub profile_aware: bool,
}Expand description
Per-model sampling parameter overrides resolved from a custom provider
profile. Every field defaults to None, meaning the agent loop’s global
configuration value applies unchanged.
Fields§
§temperature: Option<f32>Sampling temperature (0.0-2.0).
top_p: Option<f32>Nucleus sampling mass (0.0-1.0).
top_k: Option<i32>Top-k token cutoff (>= 0).
presence_penalty: Option<f32>Presence penalty (-2.0-2.0).
frequency_penalty: Option<f32>Frequency penalty (-2.0-2.0).
max_tokens: Option<u32>Maximum output tokens (> 0).
reasoning_effort: Option<ReasoningEffortLevel>Reasoning effort for models that accept it.
suppresses_sampling_with_reasoning: boolWhether this model’s wire format rejects sampling parameters while reasoning is active (e.g. custom endpoints speaking the Anthropic Messages shape).
profile_aware: boolSet by providers that resolve overrides from an explicit user profile; callers use it to trust these values over name-based heuristics.
Implementations§
Source§impl SamplingOverrides
impl SamplingOverrides
Sourcepub fn suppresses_sampling(
&self,
native_match: bool,
reasoning_active: bool,
) -> bool
pub fn suppresses_sampling( &self, native_match: bool, reasoning_active: bool, ) -> bool
Whether sampling parameters must be dropped for this request: either
the model’s wire format rejects sampling while reasoning is active, or
a built-in Anthropic/MiniMax-shaped backend (native_match) enforces
the same rule outside of profile-aware routing.
Trait Implementations§
Source§impl Clone for SamplingOverrides
impl Clone for SamplingOverrides
impl Copy for SamplingOverrides
Source§impl Debug for SamplingOverrides
impl Debug for SamplingOverrides
Source§impl Default for SamplingOverrides
impl Default for SamplingOverrides
Source§impl PartialEq for SamplingOverrides
impl PartialEq for SamplingOverrides
impl StructuralPartialEq for SamplingOverrides
Auto Trait Implementations§
impl Freeze for SamplingOverrides
impl RefUnwindSafe for SamplingOverrides
impl Send for SamplingOverrides
impl Sync for SamplingOverrides
impl Unpin for SamplingOverrides
impl UnsafeUnpin for SamplingOverrides
impl UnwindSafe for SamplingOverrides
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<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> 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