Class: HermesAgent::Client::Entities::ChatUsage
- Inherits:
-
HermesAgent::Client::Entity
- Object
- HermesAgent::Client::Entity
- HermesAgent::Client::Entities::ChatUsage
- Defined in:
- lib/hermes_agent/client/entities/chat_completion.rb
Overview
The token usage reported for a chat completion (HermesAgent::Client::Entities::ChatCompletion#usage).
Instance Method Summary collapse
-
#completion_tokens ⇒ Integer?
The number of tokens in the generated completion.
-
#prompt_tokens ⇒ Integer?
The number of tokens in the prompt.
-
#total_tokens ⇒ Integer?
The total number of tokens used (prompt plus completion).
Methods inherited from HermesAgent::Client::Entity
Instance Method Details
#completion_tokens ⇒ Integer?
The number of tokens in the generated completion.
48 49 50 |
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 48 def completion_tokens self["completion_tokens"] end |
#prompt_tokens ⇒ Integer?
The number of tokens in the prompt.
40 41 42 |
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 40 def prompt_tokens self["prompt_tokens"] end |
#total_tokens ⇒ Integer?
The total number of tokens used (prompt plus completion).
56 57 58 |
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 56 def total_tokens self["total_tokens"] end |