pub struct GenerationOptions { /* private fields */ }Expand description
Generation knobs. All fields are optional; unset fields keep the model’s defaults.
Implementations§
Source§impl GenerationOptions
impl GenerationOptions
Sourcepub const fn with_temperature(self, temperature: f64) -> Self
pub const fn with_temperature(self, temperature: f64) -> Self
Sampling temperature; higher values produce more varied output.
FoundationModels accepts values in 0.0..=2.0.
Sourcepub const fn with_maximum_response_tokens(self, tokens: u32) -> Self
pub const fn with_maximum_response_tokens(self, tokens: u32) -> Self
Hard cap on the number of tokens the model may emit.
Sourcepub const fn with_sampling(self, mode: SamplingMode) -> Self
pub const fn with_sampling(self, mode: SamplingMode) -> Self
Override the sampling strategy.
Sourcepub const fn with_sampling_seed(self, seed: u64) -> Self
pub const fn with_sampling_seed(self, seed: u64) -> Self
Use a deterministic random seed for non-greedy sampling.
Sourcepub const fn temperature(self) -> Option<f64>
pub const fn temperature(self) -> Option<f64>
Sampling temperature, if explicitly set.
Sourcepub const fn maximum_response_tokens(self) -> Option<u32>
pub const fn maximum_response_tokens(self) -> Option<u32>
The explicit token cap, if any.
Sourcepub const fn sampling(self) -> SamplingMode
pub const fn sampling(self) -> SamplingMode
The configured sampling strategy.
Sourcepub const fn sampling_seed(self) -> Option<u64>
pub const fn sampling_seed(self) -> Option<u64>
The deterministic random seed for top-k / top-p sampling.
Trait Implementations§
Source§impl Clone for GenerationOptions
impl Clone for GenerationOptions
Source§fn clone(&self) -> GenerationOptions
fn clone(&self) -> GenerationOptions
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 GenerationOptions
impl Debug for GenerationOptions
Source§impl Default for GenerationOptions
impl Default for GenerationOptions
Source§fn default() -> GenerationOptions
fn default() -> GenerationOptions
Returns the “default value” for a type. Read more
Source§impl PartialEq for GenerationOptions
impl PartialEq for GenerationOptions
Source§fn eq(&self, other: &GenerationOptions) -> bool
fn eq(&self, other: &GenerationOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for GenerationOptions
impl StructuralPartialEq for GenerationOptions
Auto Trait Implementations§
impl Freeze for GenerationOptions
impl RefUnwindSafe for GenerationOptions
impl Send for GenerationOptions
impl Sync for GenerationOptions
impl Unpin for GenerationOptions
impl UnsafeUnpin for GenerationOptions
impl UnwindSafe for GenerationOptions
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