pub struct Detection {
pub id: String,
pub session_id: Option<String>,
pub thought_id: Option<String>,
pub detection_type: DetectionType,
pub detected_issue: String,
pub severity: i32,
pub confidence: f64,
pub explanation: String,
pub remediation: Option<String>,
pub created_at: DateTime<Utc>,
pub metadata: Option<Value>,
}Expand description
Detection result from bias or fallacy analysis.
Fields§
§id: StringUnique detection identifier.
session_id: Option<String>Optional parent session ID.
thought_id: Option<String>Optional thought ID being analyzed.
detection_type: DetectionTypeType of detection (bias or fallacy).
detected_issue: StringName of the detected issue (e.g., “confirmation_bias”).
severity: i32Severity level (1-5, where 5 is most severe).
confidence: f64Confidence in the detection (0.0-1.0).
explanation: StringExplanation of why this was detected.
remediation: Option<String>Optional remediation suggestion.
created_at: DateTime<Utc>When the detection was created.
metadata: Option<Value>Optional metadata.
Implementations§
Source§impl Detection
impl Detection
Sourcepub fn new(
detection_type: DetectionType,
detected_issue: impl Into<String>,
severity: i32,
confidence: f64,
explanation: impl Into<String>,
) -> Self
pub fn new( detection_type: DetectionType, detected_issue: impl Into<String>, severity: i32, confidence: f64, explanation: impl Into<String>, ) -> Self
Create a new detection result
Sourcepub fn with_session(self, session_id: impl Into<String>) -> Self
pub fn with_session(self, session_id: impl Into<String>) -> Self
Set the session ID
Sourcepub fn with_thought(self, thought_id: impl Into<String>) -> Self
pub fn with_thought(self, thought_id: impl Into<String>) -> Self
Set the thought ID
Sourcepub fn with_remediation(self, remediation: impl Into<String>) -> Self
pub fn with_remediation(self, remediation: impl Into<String>) -> Self
Set the remediation suggestion
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Set metadata
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Detection
impl<'de> Deserialize<'de> for Detection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Detection
impl RefUnwindSafe for Detection
impl Send for Detection
impl Sync for Detection
impl Unpin for Detection
impl UnwindSafe for Detection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more