Class: Lemans::Results::Usage
- Inherits:
-
Data
- Object
- Data
- Lemans::Results::Usage
- Defined in:
- lib/lemans/results/usage.rb
Overview
What a trial spent. Cache tokens count separately, and the cost carries its own provenance — $0.00 is the figure most in need of auditing.
Instance Attribute Summary collapse
-
#cached_tokens ⇒ Object
readonly
Returns the value of attribute cached_tokens.
-
#cost_source ⇒ Object
readonly
Returns the value of attribute cost_source.
-
#cost_usd ⇒ Object
readonly
Returns the value of attribute cost_usd.
-
#input_tokens ⇒ Object
readonly
Returns the value of attribute input_tokens.
-
#output_tokens ⇒ Object
readonly
Returns the value of attribute output_tokens.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cached_tokens ⇒ Object (readonly)
Returns the value of attribute cached_tokens
7 8 9 |
# File 'lib/lemans/results/usage.rb', line 7 def cached_tokens @cached_tokens end |
#cost_source ⇒ Object (readonly)
Returns the value of attribute cost_source
7 8 9 |
# File 'lib/lemans/results/usage.rb', line 7 def cost_source @cost_source end |
#cost_usd ⇒ Object (readonly)
Returns the value of attribute cost_usd
7 8 9 |
# File 'lib/lemans/results/usage.rb', line 7 def cost_usd @cost_usd end |
#input_tokens ⇒ Object (readonly)
Returns the value of attribute input_tokens
7 8 9 |
# File 'lib/lemans/results/usage.rb', line 7 def input_tokens @input_tokens end |
#output_tokens ⇒ Object (readonly)
Returns the value of attribute output_tokens
7 8 9 |
# File 'lib/lemans/results/usage.rb', line 7 def output_tokens @output_tokens end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps
7 8 9 |
# File 'lib/lemans/results/usage.rb', line 7 def steps @steps end |
Class Method Details
.zero ⇒ Object
8 9 10 |
# File 'lib/lemans/results/usage.rb', line 8 def self.zero new(input_tokens: 0, output_tokens: 0, cached_tokens: 0, cost_usd: 0.0, steps: 0, cost_source: CostSource.none) end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/lemans/results/usage.rb', line 12 def to_h { input_tokens: input_tokens, output_tokens: output_tokens, cached_tokens: cached_tokens, cost_usd: cost_usd, steps: steps, cost_source: cost_source&.to_h } end |