Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
ContextTraceEmitter
Defined in the trace module.
Rust AI Agent SDK
Context trace emitter.
Fields
| Name | Type | Description |
|---|
sink | Box<dyn ContextTraceSinkProtocol> | - |
Methods
new
fn new(sink: impl ContextTraceSinkProtocol + 'static) -> Self
Create with a specific sink.
Parameters:
| Name | Type |
|---|
sink | impl ContextTraceSinkProtocol + 'static |
noop
Create with no-op sink (zero overhead).
with_list_sink
fn with_list_sink() -> Self
Create with list sink.
emit
fn emit(&mut self, event: ContextEvent) -> ()
Emit an event.
Parameters:
| Name | Type |
|---|
event | ContextEvent |
events
fn events(&self) -> &[ContextEvent]
Get events.
clear
fn clear(&mut self) -> ()
Clear events.
agent_start
fn agent_start(&mut self, agent_id: &str, agent_name: &str, input: &str) -> ()
Emit agent start event.
Parameters:
| Name | Type |
|---|
agent_id | &str |
agent_name | &str |
input | &str |
agent_end
fn agent_end(&mut self, agent_id: &str, agent_name: &str, output: &str, duration_ms: u64) -> ()
Emit agent end event.
Parameters:
| Name | Type |
|---|
agent_id | &str |
agent_name | &str |
output | &str |
duration_ms | u64 |
fn tool_start(&mut self, tool_name: &str, args: serde_json::Value) -> ()
Emit tool start event.
Parameters:
| Name | Type |
|---|
tool_name | &str |
args | serde_json::Value |
fn tool_end(&mut self, tool_name: &str, result: serde_json::Value, duration_ms: u64) -> ()
Emit tool end event.
Parameters:
| Name | Type |
|---|
tool_name | &str |
result | serde_json::Value |
duration_ms | u64 |
Source
View on GitHub
praisonai/src/trace/mod.rs at line 629