pub struct SamplingArgs {
pub max_tokens: u32,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub reasoning_effort: Option<ReasoningEffort>,
}Expand description
Provider-neutral sampling knobs — the common core only.
Wire-specific parameters (Anthropic top_k/stop_sequences/thinking budget,
OpenAI frequency_penalty, …) are the concern of each wire’s request builder,
not this type, keeping ConversationRequest API-agnostic (ADR-0007). Grok
Build uses the same layering: a neutral core plus per-wire superset structs.
Fields§
§max_tokens: u32The maximum number of tokens to generate.
temperature: Option<f32>Sampling temperature; a wire may omit it (e.g. Anthropic requires temp=1 when thinking is on, so the wire drops it there).
top_p: Option<f32>Nucleus-sampling probability mass.
reasoning_effort: Option<ReasoningEffort>Neutral reasoning budget; each wire maps it to its own control
(Anthropic budget_tokens, OpenAI reasoning effort).
Trait Implementations§
Source§impl Clone for SamplingArgs
impl Clone for SamplingArgs
Source§fn clone(&self) -> SamplingArgs
fn clone(&self) -> SamplingArgs
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 SamplingArgs
impl Debug for SamplingArgs
Source§impl Default for SamplingArgs
impl Default for SamplingArgs
Source§impl PartialEq for SamplingArgs
impl PartialEq for SamplingArgs
impl StructuralPartialEq for SamplingArgs
Auto Trait Implementations§
impl Freeze for SamplingArgs
impl RefUnwindSafe for SamplingArgs
impl Send for SamplingArgs
impl Sync for SamplingArgs
impl Unpin for SamplingArgs
impl UnsafeUnpin for SamplingArgs
impl UnwindSafe for SamplingArgs
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