pub enum GenerationEvent {
Started {
tool_name: String,
total_tools: usize,
current_index: usize,
},
Thinking {
thought: String,
},
Searching {
query: String,
},
SearchResult {
tools: Vec<String>,
count: usize,
},
Example {
example: GeneratedExample,
},
Validation {
valid: bool,
errors: Vec<String>,
example_index: usize,
},
Progress {
current: usize,
total: usize,
percent: f32,
message: Option<String>,
},
ToolCompleted {
tool_name: String,
examples_generated: usize,
valid_examples: usize,
duration_ms: u64,
},
Completed {
total_examples: usize,
total_valid: usize,
total_tools: usize,
duration_ms: u64,
},
Error {
message: String,
recoverable: bool,
tool_name: Option<String>,
},
AgentStep {
step: AgentStep,
},
}Expand description
Events emitted during AI-powered example generation
These events follow the SSE (Server-Sent Events) format and can be streamed to CLI or MCP clients in real-time.
Variants§
Started
Generation process has started for a tool
Fields
Thinking
LLM is processing/thinking
Searching
Performing an intermediate search
SearchResult
Search results received
Example
An example has been generated
Fields
§
example: GeneratedExampleThe generated example
Validation
Validation result for an example
Fields
Progress
Progress update
Fields
ToolCompleted
Tool generation completed
Fields
Completed
All generation completed
Fields
Error
An error occurred
Fields
AgentStep
Agent reasoning step (for self-ask patterns)
Implementations§
Source§impl GenerationEvent
impl GenerationEvent
Sourcepub fn started(
tool_name: impl Into<String>,
total_tools: usize,
current_index: usize,
) -> Self
pub fn started( tool_name: impl Into<String>, total_tools: usize, current_index: usize, ) -> Self
Create a started event
Sourcepub fn progress(current: usize, total: usize, message: Option<String>) -> Self
pub fn progress(current: usize, total: usize, message: Option<String>) -> Self
Create a progress event
Sourcepub fn tool_error(
message: impl Into<String>,
tool_name: impl Into<String>,
recoverable: bool,
) -> Self
pub fn tool_error( message: impl Into<String>, tool_name: impl Into<String>, recoverable: bool, ) -> Self
Create an error event with tool context
Sourcepub fn completed(
total_examples: usize,
total_valid: usize,
total_tools: usize,
duration: Duration,
) -> Self
pub fn completed( total_examples: usize, total_valid: usize, total_tools: usize, duration: Duration, ) -> Self
Create a completed event
Sourcepub fn to_sse_data(&self) -> String
pub fn to_sse_data(&self) -> String
Format as SSE data line
Trait Implementations§
Source§impl Clone for GenerationEvent
impl Clone for GenerationEvent
Source§fn clone(&self) -> GenerationEvent
fn clone(&self) -> GenerationEvent
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 GenerationEvent
impl Debug for GenerationEvent
Source§impl<'de> Deserialize<'de> for GenerationEvent
impl<'de> Deserialize<'de> for GenerationEvent
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 GenerationEvent
impl RefUnwindSafe for GenerationEvent
impl Send for GenerationEvent
impl Sync for GenerationEvent
impl Unpin for GenerationEvent
impl UnwindSafe for GenerationEvent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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