pub struct Resolver { /* private fields */ }
Expand description
Resolver for parsing language model outputs with validation
Implementations§
Source§impl Resolver
impl Resolver
Sourcepub fn new(
config: &ExtractConfig,
fence_output: bool,
) -> LangExtractResult<Self>
pub fn new( config: &ExtractConfig, fence_output: bool, ) -> LangExtractResult<Self>
Create a new resolver
Sourcepub fn with_validation_config(
config: &ExtractConfig,
fence_output: bool,
validation_config: ValidationConfig,
) -> LangExtractResult<Self>
pub fn with_validation_config( config: &ExtractConfig, fence_output: bool, validation_config: ValidationConfig, ) -> LangExtractResult<Self>
Create a new resolver with custom validation config
Sourcepub fn fence_output(&self) -> bool
pub fn fence_output(&self) -> bool
Get whether this resolver expects fenced output
Sourcepub fn save_raw_output(
&self,
raw_output: &str,
metadata: Option<&str>,
) -> LangExtractResult<String>
pub fn save_raw_output( &self, raw_output: &str, metadata: Option<&str>, ) -> LangExtractResult<String>
Save raw model output to a file for debugging/recovery
Sourcepub fn validate_and_parse(
&self,
raw_response: &str,
expected_fields: &[String],
) -> LangExtractResult<(Vec<Extraction>, ValidationResult)>
pub fn validate_and_parse( &self, raw_response: &str, expected_fields: &[String], ) -> LangExtractResult<(Vec<Extraction>, ValidationResult)>
Validate and parse model response with raw data preservation
Auto Trait Implementations§
impl Freeze for Resolver
impl RefUnwindSafe for Resolver
impl Send for Resolver
impl Sync for Resolver
impl Unpin for Resolver
impl UnwindSafe for Resolver
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