LLMConsumption
Base type for an amount of LLM consumption recorded during an optimization run.
This is an abstract class (not sealed) so that providers outside the library can define their own consumption flavors. Each flavor pairs with an LLMConsumptionUnit and registers a decoder via LLMConsumptionType (discovered through LLMConsumptionRegistry); serialization is handled uniformly by LLMConsumptionSerializer.
Inheritors
Properties
Functions
Adds two consumptions of the same flavor. Implementations reject mismatched flavors.
The flavor-specific fields as pretty JSON (without the top-level "unit" field).
Human-readable form, typically with input/output breakdown where applicable.
Total-only short form, e.g. "330,329.00 tokens" / "150.00 credits". Used where the input/output breakdown would be misleading or off-topic — most notably the spend-limit abort message, where there is no such thing as a separate input/output cap (cap is a single total).