pub enum RedFlagError {
ResponseTooLong {
tokens: u32,
limit: u32,
},
InvalidFormat {
expected: String,
got: String,
},
SelfCorrectionDetected {
pattern: String,
},
ConfusedReasoning {
pattern: String,
},
ParseError(String),
EmptyResponse,
InvalidJson(String),
MissingField(String),
PatternError(String),
}Expand description
Errors related to red-flag validation (Algorithm 3)
Variants§
ResponseTooLong
Response exceeds token limit.
InvalidFormat
Response format does not match expected format.
SelfCorrectionDetected
Self-correction pattern detected in response.
ConfusedReasoning
Confused reasoning detected in response.
ParseError(String)
Parse error in response.
EmptyResponse
Response is empty.
InvalidJson(String)
Invalid JSON structure in response.
MissingField(String)
Missing required field in response.
PatternError(String)
Validation pattern error.
Trait Implementations§
Source§impl Debug for RedFlagError
impl Debug for RedFlagError
Source§impl Display for RedFlagError
impl Display for RedFlagError
Source§impl Error for RedFlagError
impl Error for RedFlagError
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()
Source§impl From<RedFlagError> for MdapError
impl From<RedFlagError> for MdapError
Source§fn from(source: RedFlagError) -> Self
fn from(source: RedFlagError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RedFlagError
impl RefUnwindSafe for RedFlagError
impl Send for RedFlagError
impl Sync for RedFlagError
impl Unpin for RedFlagError
impl UnsafeUnpin for RedFlagError
impl UnwindSafe for RedFlagError
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