#[non_exhaustive]pub struct ExecutionHints {
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
}Expand description
Optional generation hints. Adapters apply each field only if the provider’s API supports it; unsupported fields are silently ignored.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_tokens: Option<u32>Upper bound on tokens generated for the completion.
temperature: Option<f32>Sampling temperature. Conventional range is 0.0..=2.0.
top_p: Option<f32>Nucleus sampling cutoff. Conventional range is 0.0..=1.0.
Implementations§
Source§impl ExecutionHints
impl ExecutionHints
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct an empty hints block — equivalent to
ExecutionHints::default but available in const contexts
and as a builder entry point.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Builder-style setter for max_tokens.
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Builder-style setter for temperature.
Sourcepub fn with_top_p(self, top_p: f32) -> Self
pub fn with_top_p(self, top_p: f32) -> Self
Builder-style setter for top_p.
Trait Implementations§
Source§impl Clone for ExecutionHints
impl Clone for ExecutionHints
Source§fn clone(&self) -> ExecutionHints
fn clone(&self) -> ExecutionHints
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 ExecutionHints
impl Debug for ExecutionHints
Source§impl Default for ExecutionHints
impl Default for ExecutionHints
Source§fn default() -> ExecutionHints
fn default() -> ExecutionHints
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ExecutionHints
impl<'de> Deserialize<'de> for ExecutionHints
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
Auto Trait Implementations§
impl Freeze for ExecutionHints
impl RefUnwindSafe for ExecutionHints
impl Send for ExecutionHints
impl Sync for ExecutionHints
impl Unpin for ExecutionHints
impl UnsafeUnpin for ExecutionHints
impl UnwindSafe for ExecutionHints
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