pub enum LlmError {
RateLimited {
retry_after: Duration,
message: Option<String>,
},
Timeout {
elapsed: Duration,
deadline: Duration,
},
AuthDenied {
message: String,
},
InvalidRequest {
message: String,
},
ModelNotFound {
model: String,
},
ContextLengthExceeded {
max_tokens: u32,
request_tokens: u32,
},
ContentFiltered {
reason: String,
},
ResponseFormatMismatch {
expected: ResponseFormat,
message: String,
},
ProviderError {
message: String,
code: Option<String>,
},
NetworkError {
message: String,
},
}Expand description
Error type for chat operations.
Variants§
RateLimited
Timeout
AuthDenied
InvalidRequest
ModelNotFound
ContextLengthExceeded
ContentFiltered
ResponseFormatMismatch
ProviderError
NetworkError
Trait Implementations§
Source§impl CapabilityError for LlmError
impl CapabilityError for LlmError
Source§fn category(&self) -> ErrorCategory
fn category(&self) -> ErrorCategory
Returns the category of this error for generic handling. Read more
Source§fn is_transient(&self) -> bool
fn is_transient(&self) -> bool
Returns
true if the underlying condition may clear without changing the request. Read moreSource§fn is_retryable(&self) -> bool
fn is_retryable(&self) -> bool
Returns
true if retrying the operation makes sense given typical idempotency. Read moreSource§impl Error for LlmError
impl Error for LlmError
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()
Auto Trait Implementations§
impl Freeze for LlmError
impl RefUnwindSafe for LlmError
impl Send for LlmError
impl Sync for LlmError
impl Unpin for LlmError
impl UnsafeUnpin for LlmError
impl UnwindSafe for LlmError
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