#[non_exhaustive]pub enum LlmError {
HttpError(String),
JsonError(String),
ProviderError {
status: u16,
message: String,
},
UnsupportedProvider(String),
MissingApiKey(String),
UnexpectedFormat(String),
}Expand description
Errors from LLM client operations.
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.
HttpError(String)
An HTTP transport error occurred.
JsonError(String)
The response body could not be parsed as JSON.
ProviderError
The provider returned a non-success HTTP status.
Fields
UnsupportedProvider(String)
The requested LLM provider is not registered.
MissingApiKey(String)
An API key is required but was not configured.
UnexpectedFormat(String)
The response format did not match the expected schema.
Implementations§
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 Forget for LlmError
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