pub struct GroundingResult {
pub status: GroundingStatus,
pub claim: String,
pub confidence: f64,
pub evidence: Vec<GroundingEvidence>,
pub reason: String,
pub suggestions: Vec<String>,
pub timestamp: DateTime<Utc>,
}Expand description
Result of a grounding check.
Mirrors the actual response shape all sisters return.
Fields§
§status: GroundingStatusGrounding status
claim: StringThe claim that was checked
confidence: f64Confidence level (0.0 = no support, 1.0 = full support)
evidence: Vec<GroundingEvidence>Evidence that supports (or fails to support) the claim
reason: StringHuman-readable explanation
suggestions: Vec<String>Suggestions for related content (when ungrounded)
timestamp: DateTime<Utc>Timestamp of grounding check
Implementations§
Source§impl GroundingResult
impl GroundingResult
Sourcepub fn ungrounded(claim: impl Into<String>, reason: impl Into<String>) -> Self
pub fn ungrounded(claim: impl Into<String>, reason: impl Into<String>) -> Self
Create an ungrounded result
Sourcepub fn with_evidence(self, evidence: Vec<GroundingEvidence>) -> Self
pub fn with_evidence(self, evidence: Vec<GroundingEvidence>) -> Self
Add evidence items
Sourcepub fn with_suggestions(self, suggestions: Vec<String>) -> Self
pub fn with_suggestions(self, suggestions: Vec<String>) -> Self
Add suggestions
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Add reason
Sourcepub fn is_strongly_grounded(&self) -> bool
pub fn is_strongly_grounded(&self) -> bool
Check if strongly grounded (confidence > 0.8)
Sourcepub fn is_weakly_grounded(&self) -> bool
pub fn is_weakly_grounded(&self) -> bool
Check if weakly grounded (confidence > 0.5)
Trait Implementations§
Source§impl Clone for GroundingResult
impl Clone for GroundingResult
Source§fn clone(&self) -> GroundingResult
fn clone(&self) -> GroundingResult
Returns a duplicate 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 GroundingResult
impl Debug for GroundingResult
Source§impl<'de> Deserialize<'de> for GroundingResult
impl<'de> Deserialize<'de> for GroundingResult
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 GroundingResult
impl RefUnwindSafe for GroundingResult
impl Send for GroundingResult
impl Sync for GroundingResult
impl Unpin for GroundingResult
impl UnsafeUnpin for GroundingResult
impl UnwindSafe for GroundingResult
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