pub enum TypedEvent {
Show 23 variants
InitEventLoop(InitEventLoopEvent),
Start(StartEvent),
StartEventLoop(StartEventLoopEvent),
ModelStreamChunk(ModelStreamChunkEvent),
ModelStream(ModelStreamEvent),
ToolUseStream(ToolUseStreamEvent),
TextStream(TextStreamEvent),
CitationStream(CitationStreamEvent),
ReasoningTextStream(ReasoningTextStreamEvent),
ReasoningRedactedContentStream(ReasoningRedactedContentStreamEvent),
ReasoningSignatureStream(ReasoningSignatureStreamEvent),
ModelStopReason(ModelStopReasonEvent),
EventLoopStop(EventLoopStopEvent),
StructuredOutput(StructuredOutputEvent),
EventLoopThrottle(EventLoopThrottleEvent),
ToolResult(ToolResultEvent),
ToolStream(ToolStreamEvent),
ToolCancel(ToolCancelEvent),
ToolInterrupt(ToolInterruptEvent),
ModelMessage(ModelMessageEvent),
ToolResultMessage(ToolResultMessageEvent),
ForceStop(ForceStopEvent),
AgentResult(AgentResultEvent),
}Expand description
Unified typed event enum for backward compatibility.
Variants§
InitEventLoop(InitEventLoopEvent)
Start(StartEvent)
StartEventLoop(StartEventLoopEvent)
ModelStreamChunk(ModelStreamChunkEvent)
ModelStream(ModelStreamEvent)
ToolUseStream(ToolUseStreamEvent)
TextStream(TextStreamEvent)
CitationStream(CitationStreamEvent)
ReasoningTextStream(ReasoningTextStreamEvent)
ReasoningRedactedContentStream(ReasoningRedactedContentStreamEvent)
ReasoningSignatureStream(ReasoningSignatureStreamEvent)
ModelStopReason(ModelStopReasonEvent)
EventLoopStop(EventLoopStopEvent)
StructuredOutput(StructuredOutputEvent)
EventLoopThrottle(EventLoopThrottleEvent)
ToolResult(ToolResultEvent)
ToolStream(ToolStreamEvent)
ToolCancel(ToolCancelEvent)
ToolInterrupt(ToolInterruptEvent)
ModelMessage(ModelMessageEvent)
ToolResultMessage(ToolResultMessageEvent)
ForceStop(ForceStopEvent)
AgentResult(AgentResultEvent)
Implementations§
Source§impl TypedEvent
impl TypedEvent
pub fn is_result(&self) -> bool
pub fn as_result(&self) -> Option<&AgentResult>
pub fn as_model_message(&self) -> Option<&Message>
pub fn as_text(&self) -> Option<String>
pub fn as_text_delta(&self) -> Option<&str>
pub fn is_callback_event(&self) -> bool
pub fn as_dict(&self) -> HashMap<String, Value>
Source§impl TypedEvent
impl TypedEvent
pub fn init_event_loop() -> Self
pub fn start() -> Self
pub fn start_event_loop() -> Self
pub fn text_stream(delta: ContentBlockDelta, text: impl Into<String>) -> Self
pub fn model_message(message: Message) -> Self
pub fn tool_result(tool_result: ToolResultType) -> Self
pub fn agent_result(result: AgentResult) -> Self
pub fn force_stop(reason: impl Into<String>) -> Self
pub fn throttle(delay: u32) -> Self
Trait Implementations§
Source§impl Clone for TypedEvent
impl Clone for TypedEvent
Source§fn clone(&self) -> TypedEvent
fn clone(&self) -> TypedEvent
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 moreAuto Trait Implementations§
impl Freeze for TypedEvent
impl RefUnwindSafe for TypedEvent
impl Send for TypedEvent
impl Sync for TypedEvent
impl Unpin for TypedEvent
impl UnwindSafe for TypedEvent
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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 moreCreates a shared type from an unshared type.