pub struct SelfCorrectingWorkflow { /* private fields */ }Expand description
A self-correcting workflow with judges
Implementations§
Source§impl SelfCorrectingWorkflow
impl SelfCorrectingWorkflow
pub fn new() -> Self
pub fn with_config(self, config: SelfCorrectConfig) -> Self
pub fn add_judge<J: Judge + 'static>(self, judge: J) -> Self
pub fn add_judge_boxed(self, judge: BoxedJudge) -> Self
pub fn max_iterations(self, max: u32) -> Self
pub fn quality_threshold(self, threshold: f32) -> Self
Sourcepub async fn execute<F, Fut>(
&self,
input: impl Into<String>,
generator: F,
) -> Result<SelfCorrectResult, SelfCorrectError>
pub async fn execute<F, Fut>( &self, input: impl Into<String>, generator: F, ) -> Result<SelfCorrectResult, SelfCorrectError>
Execute with a generator function
pub fn stats(&self) -> SelfCorrectStats
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SelfCorrectingWorkflow
impl !RefUnwindSafe for SelfCorrectingWorkflow
impl Send for SelfCorrectingWorkflow
impl Sync for SelfCorrectingWorkflow
impl Unpin for SelfCorrectingWorkflow
impl UnsafeUnpin for SelfCorrectingWorkflow
impl !UnwindSafe for SelfCorrectingWorkflow
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> 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