pub enum TruncationError {
ExceedsBudgetAfterTruncation {
payload_chars: usize,
limit_chars: usize,
},
}Expand description
The request cannot be made to fit its context budget.
Surfaces map this to their own idiom — the proxy to HTTP 400
context_length_exceeded, the in-process agent path to an error on the
completion call.
Variants§
ExceedsBudgetAfterTruncation
Still over budget after every trimmable message was trimmed.
Trait Implementations§
Source§impl Clone for TruncationError
impl Clone for TruncationError
Source§fn clone(&self) -> TruncationError
fn clone(&self) -> TruncationError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TruncationError
impl Debug for TruncationError
Source§impl Display for TruncationError
impl Display for TruncationError
Source§impl Error for TruncationError
impl Error for TruncationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for TruncationError
impl PartialEq for TruncationError
Source§fn eq(&self, other: &TruncationError) -> bool
fn eq(&self, other: &TruncationError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for TruncationError
impl StructuralPartialEq for TruncationError
Auto Trait Implementations§
impl Freeze for TruncationError
impl RefUnwindSafe for TruncationError
impl Send for TruncationError
impl Sync for TruncationError
impl Unpin for TruncationError
impl UnsafeUnpin for TruncationError
impl UnwindSafe for TruncationError
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