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

§Adapter reporters

AdapterPurpose
BufferedReporterEnqueues events for batch flushing
ChannelReporterForwards 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§

BufferedReporter
Reporter adapter that enqueues events for batch flushing.
ChannelReporter
Reporter adapter that forwards events over a channel.
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).
PolicyReporter
Adapter that wraps a FallibleObserver and applies a FailurePolicy.
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§

FailurePolicy
Policy that determines how reporter errors are handled.
ReportError
Errors that can occur while writing reports.

Traits§

FallibleObserver
A reporter whose event handling can fail.