pub enum StreamEvent {
Show 15 variants
MessagePart {
content: String,
message_id: String,
},
MessageComplete {
message: Message,
usage: Option<Usage>,
metadata: HashMap<String, String>,
model: Model,
},
ToolCallStarted {
tool_call: ToolCall,
metadata: HashMap<String, String>,
model: Model,
},
ToolCallCompleted {
tool_call_id: String,
result: ToolResult,
metadata: HashMap<String, String>,
model: Model,
},
ToolCallFailed {
tool_call_id: String,
error: String,
metadata: HashMap<String, String>,
model: Model,
},
ToolApprovalRequired {
tool_call: ToolCall,
timeout_ms: Option<u64>,
metadata: HashMap<String, String>,
},
SessionCreated {
session_id: String,
metadata: SessionMetadata,
},
SessionResumed {
session_id: String,
event_offset: u64,
},
SessionSaved {
session_id: String,
},
OperationStarted {
operation_id: Uuid,
operation: Operation,
},
OperationCompleted {
operation_id: Uuid,
outcome: OperationOutcome,
},
OperationCancelled {
operation_id: Uuid,
reason: String,
},
Error {
message: String,
error_type: ErrorType,
},
WorkspaceChanged,
WorkspaceFiles {
files: Vec<String>,
},
}Expand description
Unified event type for external consumers
Variants§
MessagePart
MessageComplete
ToolCallStarted
ToolCallCompleted
ToolCallFailed
ToolApprovalRequired
SessionCreated
SessionResumed
SessionSaved
OperationStarted
OperationCompleted
OperationCancelled
Error
WorkspaceChanged
WorkspaceFiles
Implementations§
Source§impl StreamEvent
impl StreamEvent
Sourcepub fn operation_id(&self) -> Option<&Uuid>
pub fn operation_id(&self) -> Option<&Uuid>
Get the operation ID if this event relates to an operation
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
Get the session ID if this event relates to a session
Sourcepub fn tool_call_id(&self) -> Option<&str>
pub fn tool_call_id(&self) -> Option<&str>
Get the tool call ID if this event relates to a tool call
Sourcepub fn message_id(&self) -> Option<&str>
pub fn message_id(&self) -> Option<&str>
Get the message ID if this event relates to a message
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
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 StreamEvent
impl Debug for StreamEvent
Source§impl<'de> Deserialize<'de> for StreamEvent
impl<'de> Deserialize<'de> for StreamEvent
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 StreamEvent
impl RefUnwindSafe for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnwindSafe for StreamEvent
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request