pub enum RuntimeEvent {
Show 15 variants
ToolCallStart {
tool_name: String,
call_id: String,
timestamp_ms: u64,
},
ToolCallEnd {
tool_name: String,
call_id: String,
duration_ms: u64,
success: bool,
timestamp_ms: u64,
},
LlmRequestStart {
model: String,
request_id: String,
timestamp_ms: u64,
},
LlmResponseEnd {
model: String,
request_id: String,
input_tokens: u64,
output_tokens: u64,
duration_ms: u64,
timestamp_ms: u64,
},
AgentStart {
agent_id: String,
task: String,
timestamp_ms: u64,
},
AgentEnd {
agent_id: String,
success: bool,
timestamp_ms: u64,
},
AgentError {
agent_id: String,
error: String,
timestamp_ms: u64,
},
SessionStart {
session_id: String,
timestamp_ms: u64,
},
SessionEnd {
session_id: String,
timestamp_ms: u64,
},
SessionStatusChanged {
session_id: String,
status: SessionStatus,
timestamp_ms: u64,
},
TokenUsage {
model: String,
input_tokens: u64,
output_tokens: u64,
cost_usd: f64,
timestamp_ms: u64,
},
BudgetExhausted {
budget_usd: f64,
total_cost_usd: f64,
timestamp_ms: u64,
},
ConfigReloaded {
timestamp_ms: u64,
},
ShutdownRequested {
reason: String,
timestamp_ms: u64,
},
Custom {
event_type: String,
source: String,
data: Value,
timestamp_ms: u64,
},
}Expand description
A strongly-typed event published on the bus.
Each variant carries only the data relevant to that event kind, replacing
the previous stringly-typed Event struct.
Variants§
ToolCallStart
A tool call is about to start.
ToolCallEnd
A tool call completed.
LlmRequestStart
An LLM request was sent.
LlmResponseEnd
An LLM response was received.
Fields
AgentStart
An agent started working.
AgentEnd
An agent finished.
AgentError
An agent encountered an error.
SessionStart
Session started.
SessionEnd
Session ended.
SessionStatusChanged
Session status changed (idle -> busy -> retry -> idle).
TokenUsage
Token usage was recorded.
BudgetExhausted
Session cost budget has been exhausted.
Published when [CostTracker::is_over_budget] returns true after
recording token usage. The agent loop should pause and notify the user.
ConfigReloaded
Configuration was reloaded.
ShutdownRequested
Graceful shutdown requested.
Custom
Escape hatch for events not covered by the typed variants.
Implementations§
Source§impl RuntimeEvent
impl RuntimeEvent
Sourcepub fn topic(&self) -> EventTopic
pub fn topic(&self) -> EventTopic
Return the EventTopic for this event.
Sourcepub fn timestamp_ms(&self) -> u64
pub fn timestamp_ms(&self) -> u64
Return the timestamp in milliseconds since epoch.
Trait Implementations§
Source§impl Clone for RuntimeEvent
impl Clone for RuntimeEvent
Source§fn clone(&self) -> RuntimeEvent
fn clone(&self) -> RuntimeEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more