Smith::LLM::Usage
Inherits JSON::Serializable < Struct < Value < Object
Constructors
new(pull : JSON::PullParser)
Sourcenew(prompt_tokens : Int32 = 0, completion_tokens : Int32 = 0, total_tokens : Int32 = 0, cache_creation_tokens : Int32 = 0, cache_read_tokens : Int32 = 0)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
+(other : Usage) : Usage
Sourcecache_creation_tokens
Anthropic prompt caching. Defaulted here as well as in the constructor, so sessions saved before these fields existed still deserialize.
cache_read_tokens
Sourcecompletion_tokens
Sourceprompt_tokens
Sourcetotal_tokens
Source