LLMConsumptionSerializer

JSON serializer for any LLMConsumption flavor. The on-disk shape is a single object with a top-level "unit" field (the flavor's LLMConsumptionUnit.displayLabel) plus the flavor's own pretty fields. On read, the "unit" label is resolved through LLMConsumptionRegistry to the right decoder — so no provider-specific dispatch lives here.

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Descriptor with a single "unit" field; subtype fields are dynamic and not described here.

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): LLMConsumption

Decodes a JSON object, resolving its "unit" label through LLMConsumptionRegistry. JSON only.

Link copied to clipboard
open override fun serialize(encoder: Encoder, value: LLMConsumption)

Encodes value as a JSON object of its pretty fields plus a "unit" label. JSON only.