pub enum Truncation {
Auto,
Disabled,
}
Expand description
Controls truncation behavior for long inputs
This enum defines how the system should handle inputs that exceed the maximum context length.
§API Reference
Corresponds to the truncation
parameter in the OpenAI Responses API.
Variants§
Auto
Automatically truncate inputs to fit context length
The system will automatically trim inputs to ensure they fit within the model’s context window.
Disabled
Disable truncation - return error if input is too long
The system will return an error rather than truncating inputs that exceed the context length.
Trait Implementations§
Source§impl Clone for Truncation
impl Clone for Truncation
Source§fn clone(&self) -> Truncation
fn clone(&self) -> Truncation
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 Truncation
impl Debug for Truncation
Source§impl Display for Truncation
impl Display for Truncation
Source§impl FromStr for Truncation
impl FromStr for Truncation
Source§impl PartialEq for Truncation
impl PartialEq for Truncation
Source§impl Serialize for Truncation
impl Serialize for Truncation
Source§impl TryFrom<&str> for Truncation
impl TryFrom<&str> for Truncation
impl StructuralPartialEq for Truncation
Auto Trait Implementations§
impl Freeze for Truncation
impl RefUnwindSafe for Truncation
impl Send for Truncation
impl Sync for Truncation
impl Unpin for Truncation
impl UnwindSafe for Truncation
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.