Skip to main content

Crate agentkit_reporting

Crate agentkit_reporting 

Source
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

ReporterPurpose
StdoutReporterHuman-readable terminal output
JsonlReporterMachine-readable newline-delimited JSON
UsageReporterAggregated token / cost totals
TranscriptReporterGrowing snapshot of conversation items
CompositeReporterFan-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§

CompositeReporter
Fan-out reporter that forwards every AgentEvent to multiple child observers.
CostTotals
Accumulated monetary cost across all events seen by a UsageReporter.
EventEnvelope
A timestamped wrapper around an AgentEvent.
JsonlReporter
Machine-readable reporter that writes one JSON object per line (JSONL).
StdoutReporter
Human-readable reporter that writes structured log lines to a Write sink.
TranscriptReporter
Reporter that captures the evolving conversation transcript.
TranscriptView
Growing list of conversation Items captured by a TranscriptReporter.
UsageReporter
Reporter that aggregates token usage and cost across the entire run.
UsageSummary
Snapshot of everything a UsageReporter has tracked so far.
UsageTotals
Accumulated token counts across all events seen by a UsageReporter.

Enums§

ReportError
Errors that can occur while writing reports.