pub enum PromptTokensError {
NotAvailable,
UnableToCompute,
PromptFormatFailed(StringTemplateError),
TokenizerError(TokenizerError),
}
Expand description
Custom error type for handling prompt token-related errors.
Variants§
NotAvailable
Indicates that prompt tokens are not accessible for the given step.
UnableToCompute
Indicates that the prompt tokens could not be computed.
PromptFormatFailed(StringTemplateError)
Indicates that the prompt tokens could not be computed because formatting the prompt failed.
TokenizerError(TokenizerError)
Trait Implementations§
Source§impl Clone for PromptTokensError
impl Clone for PromptTokensError
Source§fn clone(&self) -> PromptTokensError
fn clone(&self) -> PromptTokensError
Returns a copy of the value. Read more
1.0.0 · 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 PromptTokensError
impl Debug for PromptTokensError
Source§impl Display for PromptTokensError
impl Display for PromptTokensError
Source§impl Error for PromptTokensError
impl Error for PromptTokensError
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<PromptTokensError> for Error
impl From<PromptTokensError> for Error
Source§fn from(source: PromptTokensError) -> Self
fn from(source: PromptTokensError) -> Self
Converts to this type from the input type.
Source§impl From<PromptTokensError> for MapReduceChainError
impl From<PromptTokensError> for MapReduceChainError
Source§fn from(source: PromptTokensError) -> Self
fn from(source: PromptTokensError) -> Self
Converts to this type from the input type.
Source§impl From<StringTemplateError> for PromptTokensError
impl From<StringTemplateError> for PromptTokensError
Source§fn from(source: StringTemplateError) -> Self
fn from(source: StringTemplateError) -> Self
Converts to this type from the input type.
Source§impl From<TokenizerError> for PromptTokensError
impl From<TokenizerError> for PromptTokensError
Source§fn from(source: TokenizerError) -> Self
fn from(source: TokenizerError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PromptTokensError
impl RefUnwindSafe for PromptTokensError
impl Send for PromptTokensError
impl Sync for PromptTokensError
impl Unpin for PromptTokensError
impl UnwindSafe for PromptTokensError
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