pub enum StopField {
Single(String),
Multiple(Vec<String>),
}Expand description
Stop field that accepts either a single string or an array of strings
Per OpenAI spec, the stop parameter can be a string or an array of
up to 4 strings.
Variants§
Implementations§
Source§impl StopField
impl StopField
Sourcepub fn into_vec(self) -> Vec<String>
pub fn into_vec(self) -> Vec<String>
Convert to a Vec of strings regardless of the variant,
truncating to the OpenAI-specified maximum of 4 sequences
Sourcepub fn to_bounded_vec(&self) -> Vec<String>
pub fn to_bounded_vec(&self) -> Vec<String>
Clone only the bounded subset (up to 4 sequences) without copying the entire input — safe for use with user-controlled data
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StopField
impl<'de> Deserialize<'de> for StopField
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 StopField
impl RefUnwindSafe for StopField
impl Send for StopField
impl Sync for StopField
impl Unpin for StopField
impl UnsafeUnpin for StopField
impl UnwindSafe for StopField
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