Skip to content

AgentUsage

junjo.agent.result.AgentUsage

Kind: Class

SDK version: 0.69.0

Documentation channel: Stable release

AgentUsage(*, model_responses: int = 0, fields: Mapping[str, UsageAggregateField] | None = None)

View source

Aggregate of validated per-response provider usage facts.

Create a validated immutable aggregate.

Name Type Description Default
model_responses int Count of validated model responses, including
responses whose provider reported no usage.
0
fields Mapping[str, UsageAggregateField] | None Supported token fact aggregates only. None

model_responses: int

View source

Total responses included in the aggregate, including responses with no reported usage.

fields: Mapping[str, UsageAggregateField]

View source

Usage field name to aggregate; each field retains its own observation count.

add(usage: ModelUsage | None) -> AgentUsage

View source

Public member documented by its signature.

to_json() -> dict[str, object]

View source

Public member documented by its signature.