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 |
§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§
- 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).
- 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§
- Report
Error - Errors that can occur while writing reports.