pub struct QomRecorder { /* private fields */ }Expand description
QoM recorder - tracks events, computes metrics, persists to disk
Implementations§
Source§impl QomRecorder
impl QomRecorder
Sourcepub fn new(config: QomRecorderConfig) -> Self
pub fn new(config: QomRecorderConfig) -> Self
Create a new QoM recorder
Sourcepub async fn record_event(&self, event: QomEvent)
pub async fn record_event(&self, event: QomEvent)
Record a QoM evaluation event
Sourcepub fn create_event(
&self,
stype: &str,
profile: &str,
passed: bool,
scores: QomScores,
failure_reason: Option<String>,
payload_hash: Option<String>,
) -> QomEvent
pub fn create_event( &self, stype: &str, profile: &str, passed: bool, scores: QomScores, failure_reason: Option<String>, payload_hash: Option<String>, ) -> QomEvent
Create a QoM event from validation results
Sourcepub fn check_groundedness(
&self,
response: &str,
sources: &[SourceDocument],
) -> GroundednessResult
pub fn check_groundedness( &self, response: &str, sources: &[SourceDocument], ) -> GroundednessResult
Check groundedness of a response
Sourcepub async fn check_determinism(
&self,
stype: &str,
payload_hash: &str,
response: &Value,
) -> DeterminismResult
pub async fn check_determinism( &self, stype: &str, payload_hash: &str, response: &Value, ) -> DeterminismResult
Check determinism of a response
Sourcepub async fn check_ontology(
&self,
stype: &str,
payload: &Value,
) -> OntologyResult
pub async fn check_ontology( &self, stype: &str, payload: &Value, ) -> OntologyResult
Check ontology adherence
Sourcepub async fn load_ontology(&self, stype: &str, spec: Ontology)
pub async fn load_ontology(&self, stype: &str, spec: Ontology)
Load ontology spec for an SType
Sourcepub async fn get_summary(&self) -> QomSummary
pub async fn get_summary(&self) -> QomSummary
Get QoM summary statistics
Sourcepub async fn get_events(&self, limit: usize) -> Vec<QomEvent>
pub async fn get_events(&self, limit: usize) -> Vec<QomEvent>
Get recent events
Sourcepub async fn get_history(&self, period: &str) -> Vec<QomHistoryPoint>
pub async fn get_history(&self, period: &str) -> Vec<QomHistoryPoint>
Get history for a time period
Sourcepub async fn inc_toc_pending(&self)
pub async fn inc_toc_pending(&self)
Increment TOC pending count
Sourcepub async fn dec_toc_pending(&self)
pub async fn dec_toc_pending(&self)
Decrement TOC pending count
Sourcepub async fn persist_history(&self)
pub async fn persist_history(&self)
Persist history to disk (should be called periodically)
Sourcepub async fn load_from_disk(&self) -> Result<()>
pub async fn load_from_disk(&self) -> Result<()>
Load events from disk on startup
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QomRecorder
impl !RefUnwindSafe for QomRecorder
impl Send for QomRecorder
impl Sync for QomRecorder
impl Unpin for QomRecorder
impl !UnwindSafe for QomRecorder
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§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