Class AgentUsage
- Namespace
- Emissary
- Assembly
- Emissary.dll
Token usage accumulated across all turns of a run.
public sealed record AgentUsage : IEquatable<AgentUsage>
- Inheritance
-
AgentUsage
- Implements
- Inherited Members
Constructors
AgentUsage(long, long, long, long)
Token usage accumulated across all turns of a run.
public AgentUsage(long InputTokens, long OutputTokens, long CacheCreationInputTokens = 0, long CacheReadInputTokens = 0)
Parameters
InputTokenslongTotal input tokens (cache reads and writes counted separately).
OutputTokenslongTotal output tokens.
CacheCreationInputTokenslongInput tokens written to the prompt cache.
CacheReadInputTokenslongInput tokens served from the prompt cache.
Properties
CacheCreationInputTokens
Input tokens written to the prompt cache.
public long CacheCreationInputTokens { get; init; }
Property Value
CacheReadInputTokens
Input tokens served from the prompt cache.
public long CacheReadInputTokens { get; init; }
Property Value
InputTokens
Total input tokens (cache reads and writes counted separately).
public long InputTokens { get; init; }
Property Value
OutputTokens
Total output tokens.
public long OutputTokens { get; init; }
Property Value
Zero
No usage.
public static AgentUsage Zero { get; }
Property Value
Methods
Add(long, long, long, long)
Returns this usage plus one turn's tokens.
public AgentUsage Add(long inputTokens, long outputTokens, long cacheCreationInputTokens = 0, long cacheReadInputTokens = 0)
Parameters
inputTokenslongThe turn's input tokens.
outputTokenslongThe turn's output tokens.
cacheCreationInputTokenslongThe turn's cache-write tokens.
cacheReadInputTokenslongThe turn's cache-read tokens.