pub enum OutputValidationError {
Failed {
message: String,
retry: bool,
},
ModelRetry(String),
Parse(OutputParseError),
}Expand description
Error during output validation.
Variants§
Failed
Validation failed.
ModelRetry(String)
Model should retry with a different response.
Parse(OutputParseError)
Parse error during validation.
Implementations§
Source§impl OutputValidationError
impl OutputValidationError
Sourcepub fn retry(msg: impl Into<String>) -> Self
pub fn retry(msg: impl Into<String>) -> Self
Create a retry error with a message for the model.
Sourcepub fn failed_retry(msg: impl Into<String>) -> Self
pub fn failed_retry(msg: impl Into<String>) -> Self
Create a failed validation error (with retry).
Sourcepub fn should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Whether the model should retry.
Sourcepub fn retry_message(&self) -> Option<&str>
pub fn retry_message(&self) -> Option<&str>
Get the retry message if applicable.
Trait Implementations§
Source§impl Debug for OutputValidationError
impl Debug for OutputValidationError
Source§impl Display for OutputValidationError
impl Display for OutputValidationError
Source§impl Error for OutputValidationError
impl Error for OutputValidationError
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<OutputParseError> for OutputValidationError
impl From<OutputParseError> for OutputValidationError
Source§fn from(source: OutputParseError) -> Self
fn from(source: OutputParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OutputValidationError
impl !RefUnwindSafe for OutputValidationError
impl Send for OutputValidationError
impl Sync for OutputValidationError
impl Unpin for OutputValidationError
impl !UnwindSafe for OutputValidationError
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