Expand description
Reporting observers for the agentkit agent loop.
This crate provides LoopObserver implementations that turn
AgentEvents into logs, usage summaries, transcripts, and
machine-readable JSONL streams. Reporters are designed to be composed
through CompositeReporter so a single loop can feed multiple
observers at once.
§Included reporters
| Reporter | Purpose |
|---|---|
StdoutReporter | Human-readable terminal output |
JsonlReporter | Machine-readable newline-delimited JSON |
UsageReporter | Aggregated token / cost totals |
TranscriptReporter | Growing snapshot of conversation items |
CompositeReporter | Fan-out to multiple reporters |
§Adapter reporters
| Adapter | Purpose |
|---|---|
BufferedReporter | Enqueues events for batch flushing |
ChannelReporter | Forwards events to another thread or task |
[TracingReporter] | Converts events into tracing spans and events (requires tracing feature) |
§Failure policy
Wrap a FallibleObserver in a PolicyReporter to control how
errors are handled — see FailurePolicy.
§Quick start
use agentkit_reporting::{CompositeReporter, JsonlReporter, UsageReporter, TranscriptReporter};
let reporter = CompositeReporter::new()
.with_observer(JsonlReporter::new(Vec::new()))
.with_observer(UsageReporter::new())
.with_observer(TranscriptReporter::new());Structs§
- Buffered
Reporter - Reporter adapter that enqueues events for batch flushing.
- Channel
Reporter - Reporter adapter that forwards events over a channel.
- Composite
Reporter - Fan-out reporter that forwards every
AgentEventto multiple child observers. - Cost
Totals - Accumulated monetary cost across all events seen by a
UsageReporter. - Event
Envelope - A timestamped wrapper around an
AgentEvent. - Jsonl
Reporter - Machine-readable reporter that writes one JSON object per line (JSONL).
- Policy
Reporter - Adapter that wraps a
FallibleObserverand applies aFailurePolicy. - Stdout
Reporter - Human-readable reporter that writes structured log lines to a
Writesink. - Transcript
Reporter - Reporter that captures the evolving conversation transcript.
- Transcript
View - Growing list of conversation
Items captured by aTranscriptReporter. - Usage
Reporter - Reporter that aggregates token usage and cost across the entire run.
- Usage
Summary - Snapshot of everything a
UsageReporterhas tracked so far. - Usage
Totals - Accumulated token counts across all events seen by a
UsageReporter.
Enums§
- Failure
Policy - Policy that determines how reporter errors are handled.
- Report
Error - Errors that can occur while writing reports.
Traits§
- Fallible
Observer - A reporter whose event handling can fail.