Skip to main content

SwarmEvent

Enum SwarmEvent 

Source
#[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.

Fields

§agent: String

The agent.

§

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.

Fields

§agent: String

The agent.

§text: String

The new text.

§

Resumed

The run resumed from its checkpoint: the first event of a resumed stream_as run.

Fields

§agent: String

The agent whose turn starts the resumed run.

§handoffs: usize

The handoffs made before the run stopped.

§

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§

Source§

impl Debug for SwarmEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for SwarmEvent

§

impl !UnwindSafe for SwarmEvent

§

impl Forget for SwarmEvent

§

impl Freeze for SwarmEvent
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<Value>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze, *const ArcInner<Inner<String>> is !null: Freeze, PhantomData<ArcInner<Inner<String>>>: Freeze, PhantomData<Pause>: Freeze, *const Result<SwarmRun, SwarmError> is !null: Freeze, PhantomData<Result<SwarmRun, SwarmError>>: Freeze,

§

impl Move for SwarmEvent

§

impl Send for SwarmEvent
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, Arc<Inner<String>>: Send, Arc<Mutex<ClockState>>: Send, BoxRaw<Result<SwarmRun, SwarmError>>: Send,

§

impl Sync for SwarmEvent
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, Arc<Inner<String>>: Sync, Arc<Mutex<ClockState>>: Sync, BoxRaw<Result<SwarmRun, SwarmError>>: Sync,

§

impl Unpin for SwarmEvent
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, Arc<Inner<String>>: Unpin, Arc<Mutex<ClockState>>: Unpin, Box<Result<SwarmRun, SwarmError>>: Unpin,

§

impl UnsafeUnpin for SwarmEvent

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more