pub struct GenerationOptions {
pub temperature: Option<f64>,
pub sampling: Option<Sampling>,
pub max_response_tokens: Option<u32>,
pub seed: Option<u64>,
}Expand description
Options that control how the model generates its response.
Use the builder pattern to configure options:
use fm_rs::GenerationOptions;
let options = GenerationOptions::builder()
.temperature(0.7)
.max_response_tokens(500)
.build();Fields§
§temperature: Option<f64>Temperature for sampling (0.0-2.0). Higher values produce more random outputs.
sampling: Option<Sampling>Sampling strategy.
max_response_tokens: Option<u32>Maximum number of tokens in the response.
seed: Option<u64>Random seed for reproducible generation.
Note: This field is currently not supported by Apple’s GenerationOptions API
and is ignored. It is included for potential future use.
Implementations§
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 · 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<'de> Deserialize<'de> for GenerationOptions
impl<'de> Deserialize<'de> for GenerationOptions
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 GenerationOptions
impl RefUnwindSafe for GenerationOptions
impl Send for GenerationOptions
impl Sync for GenerationOptions
impl Unpin 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