pub enum Error {
Unavailable(AvailabilityError),
Generation(GenerationError),
NullByte(NulError),
InvalidTemperature(f64),
InvalidMaxTokens(usize),
Json(Error),
ToolError {
name: ToolName,
error: ToolCallError,
},
}Expand description
Errors returned by this crate.
Variants§
Apple Intelligence is not available on this device.
Generation(GenerationError)
The model produced an error during text generation.
NullByte(NulError)
An argument contained a null byte and could not be converted to a C string.
InvalidTemperature(f64)
A temperature value outside the valid range [0.0, 2.0] was supplied.
InvalidMaxTokens(usize)
A max_tokens value too large for the AIMX bridge was supplied.
Json(Error)
JSON serialisation or deserialisation failed.
ToolError
A tool invoked by the model returned an error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 From<GenerationError> for Error
impl From<GenerationError> for Error
Source§fn from(source: GenerationError) -> Self
fn from(source: GenerationError) -> Self
Converts to this type from the input type.
Source§impl From<Infallible> for Error
impl From<Infallible> for Error
Source§fn from(error: Infallible) -> Self
fn from(error: Infallible) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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