pub struct StopSequenceConfig {
pub stop_tokens: HashSet<TokenIdType>,
pub stop_sequences: Vec<String>,
pub visible_stop_tokens: HashSet<TokenIdType>,
pub visible_stop_sequences: Vec<String>,
}Expand description
Configuration for stop sequences
Fields§
§stop_tokens: HashSet<TokenIdType>Token IDs that trigger a stop
stop_sequences: Vec<String>String sequences that trigger a stop
visible_stop_tokens: HashSet<TokenIdType>Token IDs for visible stops (included in output)
visible_stop_sequences: Vec<String>String sequences for visible stops (included in output)
Implementations§
Source§impl StopSequenceConfig
impl StopSequenceConfig
Sourcepub fn with_stop_token(self, token_id: TokenIdType) -> Self
pub fn with_stop_token(self, token_id: TokenIdType) -> Self
Builder pattern - add a stop token
Sourcepub fn with_stop_sequence(self, sequence: impl Into<String>) -> Self
pub fn with_stop_sequence(self, sequence: impl Into<String>) -> Self
Builder pattern - add a stop sequence
Sourcepub fn with_visible_stop_token(self, token_id: TokenIdType) -> Self
pub fn with_visible_stop_token(self, token_id: TokenIdType) -> Self
Builder pattern - add a visible stop token
Sourcepub fn with_visible_stop_sequence(self, sequence: impl Into<String>) -> Self
pub fn with_visible_stop_sequence(self, sequence: impl Into<String>) -> Self
Builder pattern - add a visible stop sequence
Trait Implementations§
Source§impl Clone for StopSequenceConfig
impl Clone for StopSequenceConfig
Source§fn clone(&self) -> StopSequenceConfig
fn clone(&self) -> StopSequenceConfig
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 StopSequenceConfig
impl Debug for StopSequenceConfig
Source§impl Default for StopSequenceConfig
impl Default for StopSequenceConfig
Source§fn default() -> StopSequenceConfig
fn default() -> StopSequenceConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StopSequenceConfig
impl RefUnwindSafe for StopSequenceConfig
impl Send for StopSequenceConfig
impl Sync for StopSequenceConfig
impl Unpin for StopSequenceConfig
impl UnsafeUnpin for StopSequenceConfig
impl UnwindSafe for StopSequenceConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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