pub struct GenParams {
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<usize>,
pub seed: Option<u64>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub repeat_penalty: Option<f32>,
pub stop: Vec<String>,
}Expand description
The validated, per-request generation config handed to ChatGenerator::chat. None fields
mean “the request didn’t say” — the generator leaves the process default (INFR_TEMP /
INFR_TOP_K / INFR_TOP_P / INFR_MAX_NEW) in charge for exactly those.
Fields§
§max_tokens: Option<u32>§temperature: Option<f32>§top_p: Option<f32>§top_k: Option<usize>§seed: Option<u64>§presence_penalty: Option<f32>§frequency_penalty: Option<f32>§repeat_penalty: Option<f32>§stop: Vec<String>Already normalised: empty strings dropped (an empty stop would fire on the first token).
Implementations§
Source§impl GenParams
impl GenParams
Sourcepub fn from_request(req: &ChatRequest) -> Result<Self, ParamError>
pub fn from_request(req: &ChatRequest) -> Result<Self, ParamError>
Validate + normalise the request’s sampling fields. Out-of-range values are a 400, NEVER a silent clamp and never a panic (OpenAI’s own ranges: temperature 0..2, top_p 0..1, presence/frequency -2..2, at most 4 stop sequences).
Trait Implementations§
impl StructuralPartialEq for GenParams
Auto Trait Implementations§
impl Freeze for GenParams
impl RefUnwindSafe for GenParams
impl Send for GenParams
impl Sync for GenParams
impl Unpin for GenParams
impl UnsafeUnpin for GenParams
impl UnwindSafe for GenParams
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
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
Converts
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> ⓘ
Converts
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