Class: OmniAI::Embed::Usage
- Inherits:
-
Object
- Object
- OmniAI::Embed::Usage
- Defined in:
- lib/omniai/embed/usage.rb
Overview
Token usage returned by the API.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(prompt_tokens:, total_tokens:) ⇒ Usage
constructor
A new instance of Usage.
- #inspect ⇒ String
Constructor Details
#initialize(prompt_tokens:, total_tokens:) ⇒ Usage
Returns a new instance of Usage.
15 16 17 18 |
# File 'lib/omniai/embed/usage.rb', line 15 def initialize(prompt_tokens:, total_tokens:) @prompt_tokens = prompt_tokens @total_tokens = total_tokens end |
Instance Attribute Details
#prompt_tokens ⇒ Integer
8 9 10 |
# File 'lib/omniai/embed/usage.rb', line 8 def prompt_tokens @prompt_tokens end |
#total_tokens ⇒ Integer
11 12 13 |
# File 'lib/omniai/embed/usage.rb', line 11 def total_tokens @total_tokens end |
Instance Method Details
#inspect ⇒ String
21 22 23 |
# File 'lib/omniai/embed/usage.rb', line 21 def inspect "#<#{self.class.name} prompt_tokens=#{@prompt_tokens} total_tokens=#{@total_tokens}>" end |