nat.data_models.token_usage#

Classes#

TokenUsageBaseModel

Shared token usage counters emitted by LLM/tool events.

Module Contents#

class TokenUsageBaseModel(/, **data: Any)#

Bases: pydantic.BaseModel

Shared token usage counters emitted by LLM/tool events.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

prompt_tokens: int = None#
completion_tokens: int = None#
cached_tokens: int = None#
reasoning_tokens: int = None#
total_tokens: int = None#