#[non_exhaustive]pub enum GenAiError {
RateLimited,
ContextLengthExceeded,
ContentFilter,
ModelOverloaded,
BudgetExceeded(BudgetExceededReason),
ModelNotFound,
InvalidRequest(String),
}Expand description
Typed AI error sentinels.
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.
RateLimited
Provider rate limit was hit.
ContextLengthExceeded
Request exceeded model context length.
ContentFilter
Content filter rejected the request or response.
ModelOverloaded
Model is overloaded.
BudgetExceeded(BudgetExceededReason)
Budget was exceeded.
ModelNotFound
Requested model was not found.
InvalidRequest(String)
Request was invalid.
Trait Implementations§
Source§impl Clone for GenAiError
impl Clone for GenAiError
Source§fn clone(&self) -> GenAiError
fn clone(&self) -> GenAiError
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 GenAiError
impl Debug for GenAiError
Source§impl Display for GenAiError
impl Display for GenAiError
impl Eq for GenAiError
Source§impl Error for GenAiError
impl Error for GenAiError
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 GenAiError
impl PartialEq for GenAiError
impl StructuralPartialEq for GenAiError
Auto Trait Implementations§
impl Freeze for GenAiError
impl RefUnwindSafe for GenAiError
impl Send for GenAiError
impl Sync for GenAiError
impl Unpin for GenAiError
impl UnsafeUnpin for GenAiError
impl UnwindSafe for GenAiError
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