pub enum LLMError {
Show 13 variants
Configuration {
message: String,
},
Authentication {
details: String,
},
Network {
message: String,
},
RateLimit {
retry_after_seconds: u64,
},
InvalidParameters {
details: String,
},
ProviderError {
code: i32,
message: String,
},
Timeout {
seconds: u64,
},
ContentProcessing {
details: String,
},
TokenLimitExceeded {
used: usize,
limit: usize,
},
ModelNotAvailable {
model: String,
},
ProviderNotFound {
provider: String,
},
Session {
message: String,
},
Generic {
message: String,
},
}
Expand description
Errors that can occur during LLM operations
Variants§
Configuration
Configuration errors
Authentication
Authentication failures
Network
Network and connectivity issues
RateLimit
API rate limiting
InvalidParameters
Model or parameter validation errors
ProviderError
Provider-specific errors
Timeout
Request timeout
ContentProcessing
Content processing errors
TokenLimitExceeded
Token limit exceeded
ModelNotAvailable
Model not available
ProviderNotFound
Provider not found
Session
Session management errors
Generic
Generic errors
Implementations§
Source§impl LLMError
impl LLMError
Sourcepub fn configuration(message: impl Into<String>) -> Self
pub fn configuration(message: impl Into<String>) -> Self
Create a configuration error
Sourcepub fn authentication(details: impl Into<String>) -> Self
pub fn authentication(details: impl Into<String>) -> Self
Create an authentication error
Sourcepub fn invalid_parameters(details: impl Into<String>) -> Self
pub fn invalid_parameters(details: impl Into<String>) -> Self
Create an invalid parameters error
Sourcepub fn provider_error(code: i32, message: impl Into<String>) -> Self
pub fn provider_error(code: i32, message: impl Into<String>) -> Self
Create a provider error
Sourcepub fn content_processing(details: impl Into<String>) -> Self
pub fn content_processing(details: impl Into<String>) -> Self
Create a content processing error
Sourcepub fn token_limit_exceeded(used: usize, limit: usize) -> Self
pub fn token_limit_exceeded(used: usize, limit: usize) -> Self
Create a token limit error
Sourcepub fn model_not_available(model: impl Into<String>) -> Self
pub fn model_not_available(model: impl Into<String>) -> Self
Create a model not available error
Sourcepub fn provider_not_found(provider: impl Into<String>) -> Self
pub fn provider_not_found(provider: impl Into<String>) -> Self
Create a provider not found error
Trait Implementations§
Source§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 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