Table of Contents

Class MailAnsweringPeriodBounds

Namespace
MailFathom.Application.Retrieval.AskMail
Assembly
MailFathom.Application.dll

What every answering run of one period may add up to before the next question is refused.

public sealed record MailAnsweringPeriodBounds : IEquatable<MailAnsweringPeriodBounds>
Inheritance
MailAnsweringPeriodBounds
Implements
Inherited Members

Remarks

The ceiling a per-run bound cannot state. MailAnsweringRunBounds makes one question cost a knowable amount, and nothing about the MCP surface stops a client from asking a hundred of them in a minute — so without an aggregate an instance's provider bill is a function of how enthusiastic its client is rather than of what its operator agreed to.

Two ceilings over one period, for the reason a run has three: the run count is the one that always works, and the token count is the one stated in what a provider bills. An endpoint that reports no usage leaves the second unreachable, and an instance answering many cheap questions never approaches it while the first is exactly the bound that applies.

The period is a fixed window anchored at the Unix epoch, which is the same placement EmbeddingSpendBudget gives the other spend ceiling this product has: a fixed window has a start an operator can name and a roll-over instant a refused caller can be told to come back at, while a rolling one would need every run's timestamp kept for the length of the window. Anchoring it at the epoch is what lets every restart of a process agree on where a period begins without anything being stored to say so.

What the fixed window costs is stated rather than hidden: a client that spends the whole ceiling at the end of one window and again at the start of the next has spent twice the ceiling across an interval of the same length.

Properties

Default

Gets the bounds a deployment that states none receives.

MaximumRuns

Gets the greatest number of runs one period may admit.

MaximumTokens

Gets the greatest number of tokens the runs of one period may consume between them.

Period

Gets how long one period lasts before what was spent in it is forgotten.

Methods

Create(TimeSpan, int, long)

Creates bounds, refusing values no period could admit a question under.

PeriodEndAt(DateTimeOffset)

Finds when the period an instant falls in rolls over, which is when a refused question is worth asking again.

PeriodStartAt(DateTimeOffset)

Finds the start of the period an instant falls in, which is the key its counts are held under.

ToString()

Returns a string that represents the current object.