Table of Contents

Constructor AgentModelCharged

Namespace
MailFathom.Application.Agent.Conversations
Assembly
MailFathom.Application.dll

AgentModelCharged(AgentMessageId, long, long)

What the first call of a run sent and what the provider charged for it.

public AgentModelCharged(AgentMessageId MessageId, long SentCharacters, long InputTokens)

Parameters

MessageId AgentMessageId

The answer whose run made the call.

SentCharacters long

How many characters of text the call sent.

InputTokens long

How many input tokens the provider reported charging for them.

Remarks

This is what the budget a turn is measured against is corrected from. A conversation's size is estimated in characters, because that is what can be counted before anything is sent, and converted into tokens at the rate the last turn was actually charged — so the estimate follows whatever model the deployment is running without this repository keeping a tokenizer for anybody's model.

Only the first call is recorded, because it is the one whose input is the conversation itself: every later call of the same run adds the run's own tool traffic, which says nothing about how the next turn's history will be charged. A provider that reports no usage leaves no entry, and the estimate keeps the rate it had.

Exceptions

ArgumentOutOfRangeException

Thrown when either count is not positive.