pub struct HealingMetadata {
pub flags: Vec<CoercionFlag>,
pub confidence: f32,
pub original_error: String,
}Expand description
Metadata about healing/coercion applied to a response.
When native structured output parsing fails and healing is enabled, this metadata tracks all transformations applied to recover the response.
Fields§
§flags: Vec<CoercionFlag>All coercion flags applied during healing
confidence: f32Confidence score (0.0-1.0) of the healed response
original_error: StringThe original parsing error that triggered healing
Implementations§
Source§impl HealingMetadata
impl HealingMetadata
Sourcepub fn new(
flags: Vec<CoercionFlag>,
confidence: f32,
original_error: String,
) -> Self
pub fn new( flags: Vec<CoercionFlag>, confidence: f32, original_error: String, ) -> Self
Create new healing metadata.
Sourcepub fn has_major_coercions(&self) -> bool
pub fn has_major_coercions(&self) -> bool
Check if any major coercions were applied.
Sourcepub fn is_confident(&self, threshold: f32) -> bool
pub fn is_confident(&self, threshold: f32) -> bool
Check if confidence meets a threshold.
Trait Implementations§
Source§impl Clone for HealingMetadata
impl Clone for HealingMetadata
Source§fn clone(&self) -> HealingMetadata
fn clone(&self) -> HealingMetadata
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 HealingMetadata
impl Debug for HealingMetadata
Source§impl<'de> Deserialize<'de> for HealingMetadata
impl<'de> Deserialize<'de> for HealingMetadata
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
Source§impl PartialEq for HealingMetadata
impl PartialEq for HealingMetadata
Source§impl Serialize for HealingMetadata
impl Serialize for HealingMetadata
impl StructuralPartialEq for HealingMetadata
Auto Trait Implementations§
impl Freeze for HealingMetadata
impl RefUnwindSafe for HealingMetadata
impl Send for HealingMetadata
impl Sync for HealingMetadata
impl Unpin for HealingMetadata
impl UnwindSafe for HealingMetadata
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