#[non_exhaustive]pub enum SwarmEvent {
AgentStarted {
agent: String,
},
Text {
agent: String,
text: String,
},
Resumed {
agent: String,
handoffs: usize,
},
Handoff(Handoff),
Question(Question),
Finished(Box<Result<SwarmRun, SwarmError>>),
}Expand description
What a streamed swarm 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.
AgentStarted
An agent’s turn started.
Text
Text an agent’s model wrote. A turn that ends in a handoff may write some before calling the tool; the final answer is the last turn’s.
Resumed
The run resumed from its checkpoint: the first event of a resumed
stream_as run.
Fields
Handoff(Handoff)
An agent passed the work on.
Question(Question)
An agent asks a person; it waits for the answer,
and the run’s timeouts stop meanwhile. See SwarmBuilder::allow_questions.
Finished(Box<Result<SwarmRun, SwarmError>>)
The run ended: the last event. Boxed, so the many text events stay small.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SwarmEvent
impl !UnwindSafe for SwarmEvent
impl Forget for SwarmEvent
impl Freeze for SwarmEvent
impl Move for SwarmEvent
impl Send for SwarmEvent
impl Sync for SwarmEvent
impl Unpin for SwarmEvent
impl UnsafeUnpin for SwarmEvent
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