#[non_exhaustive]pub enum ModelUsageError {
CachedInputExceedsInput {
input_tokens: TokenCount,
cached_input_tokens: TokenCount,
},
ReasoningExceedsOutput {
output_tokens: TokenCount,
reasoning_tokens: TokenCount,
},
TotalTokensOverflow,
}Expand description
Invalid normalized model-attempt usage.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
CachedInputExceedsInput
Cached input was larger than inclusive input.
Fields
§
input_tokens: TokenCountInclusive input total.
§
cached_input_tokens: TokenCountInvalid cached-input subset.
ReasoningExceedsOutput
Reasoning output was larger than inclusive output.
Fields
§
output_tokens: TokenCountInclusive output total.
§
reasoning_tokens: TokenCountInvalid reasoning subset.
TotalTokensOverflow
Inclusive input plus output could not be represented.
Trait Implementations§
Source§impl Clone for ModelUsageError
impl Clone for ModelUsageError
Source§impl Debug for ModelUsageError
impl Debug for ModelUsageError
Source§impl Display for ModelUsageError
impl Display for ModelUsageError
impl Eq for ModelUsageError
Source§impl Error for ModelUsageError
impl Error for ModelUsageError
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 ModelUsageError
impl PartialEq for ModelUsageError
impl StructuralPartialEq for ModelUsageError
Auto Trait Implementations§
impl Forget for ModelUsageError
impl Freeze for ModelUsageError
impl Move for ModelUsageError
impl RefUnwindSafe for ModelUsageError
impl Send for ModelUsageError
impl Sync for ModelUsageError
impl Unpin for ModelUsageError
impl UnsafeUnpin for ModelUsageError
impl UnwindSafe for ModelUsageError
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