pub struct GenerationStreamBuilder { /* private fields */ }Expand description
Builder for creating generation event streams
Implementations§
Source§impl GenerationStreamBuilder
impl GenerationStreamBuilder
Sourcepub fn new(
tool_name: impl Into<String>,
total_tools: usize,
current_index: usize,
) -> Self
pub fn new( tool_name: impl Into<String>, total_tools: usize, current_index: usize, ) -> Self
Create a new stream builder
Sourcepub fn started(&self) -> GenerationEvent
pub fn started(&self) -> GenerationEvent
Get the started event
Sourcepub fn thinking(&self, thought: impl Into<String>) -> GenerationEvent
pub fn thinking(&self, thought: impl Into<String>) -> GenerationEvent
Create a thinking event
Sourcepub fn example(&self, example: GeneratedExample) -> GenerationEvent
pub fn example(&self, example: GeneratedExample) -> GenerationEvent
Create an example event
Sourcepub fn validation(
&self,
valid: bool,
errors: Vec<String>,
example_index: usize,
) -> GenerationEvent
pub fn validation( &self, valid: bool, errors: Vec<String>, example_index: usize, ) -> GenerationEvent
Create a validation event
Sourcepub fn tool_completed(
&self,
examples_generated: usize,
valid_examples: usize,
duration: Duration,
) -> GenerationEvent
pub fn tool_completed( &self, examples_generated: usize, valid_examples: usize, duration: Duration, ) -> GenerationEvent
Create a tool completed event
Auto Trait Implementations§
impl Freeze for GenerationStreamBuilder
impl RefUnwindSafe for GenerationStreamBuilder
impl Send for GenerationStreamBuilder
impl Sync for GenerationStreamBuilder
impl Unpin for GenerationStreamBuilder
impl UnwindSafe for GenerationStreamBuilder
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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> 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