#[non_exhaustive]pub enum GraphEvent {
Resumed {
done: Vec<String>,
},
NodeStarted {
node: String,
},
Text {
node: String,
text: String,
},
NodeFinished {
node: String,
output: String,
},
NodeFailed {
node: String,
error: String,
},
Question(Question),
Finished(Box<Result<GraphRun, GraphError>>),
}Expand description
What a streamed graph run reports, as it happens.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Resumed
The run resumed from its checkpoint: the first event of a resumed
stream_as run.
NodeStarted
A node started.
Text
Text a node wrote: what an agent’s model streams, or a nested swarm’s or graph’s. Nodes with nothing to stream report only their output.
NodeFinished
A node finished.
NodeFailed
A node failed or ran out of time; its branch stops.
Question(Question)
A node asks a person; the node waits for the answer, and the run’s timeouts stop meanwhile.
Finished(Box<Result<GraphRun, GraphError>>)
The run ended: the last event. Boxed, so the many text events stay small.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GraphEvent
impl !UnwindSafe for GraphEvent
impl Forget for GraphEvent
impl Freeze for GraphEvent
impl Move for GraphEvent
impl Send for GraphEvent
impl Sync for GraphEvent
impl Unpin for GraphEvent
impl UnsafeUnpin for GraphEvent
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