Class: AgentCliRuntime::NormalizedUsage
- Inherits:
-
Data
- Object
- Data
- AgentCliRuntime::NormalizedUsage
- Defined in:
- lib/agent_cli_runtime/values.rb
Instance Attribute Summary collapse
-
#cache_read ⇒ Object
readonly
Returns the value of attribute cache_read.
-
#cache_write ⇒ Object
readonly
Returns the value of attribute cache_write.
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#reasoning ⇒ Object
readonly
Returns the value of attribute reasoning.
Instance Method Summary collapse
- #cached ⇒ Object
-
#initialize(input: nil, output: nil, cache_read: nil, cache_write: nil, reasoning: nil, cost: nil) ⇒ NormalizedUsage
constructor
A new instance of NormalizedUsage.
Constructor Details
#initialize(input: nil, output: nil, cache_read: nil, cache_write: nil, reasoning: nil, cost: nil) ⇒ NormalizedUsage
Returns a new instance of NormalizedUsage.
450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/agent_cli_runtime/values.rb', line 450 def initialize(input: nil, output: nil, cache_read: nil, cache_write: nil, reasoning: nil, cost: nil) super( input: number(input, :input, integer: true), output: number(output, :output, integer: true), cache_read: number(cache_read, :cache_read, integer: true), cache_write: number(cache_write, :cache_write, integer: true), reasoning: number(reasoning, :reasoning, integer: true), cost: number(cost, :cost, integer: false) ) end |
Instance Attribute Details
#cache_read ⇒ Object (readonly)
Returns the value of attribute cache_read
447 448 449 |
# File 'lib/agent_cli_runtime/values.rb', line 447 def cache_read @cache_read end |
#cache_write ⇒ Object (readonly)
Returns the value of attribute cache_write
447 448 449 |
# File 'lib/agent_cli_runtime/values.rb', line 447 def cache_write @cache_write end |
#cost ⇒ Object (readonly)
Returns the value of attribute cost
447 448 449 |
# File 'lib/agent_cli_runtime/values.rb', line 447 def cost @cost end |
#input ⇒ Object (readonly)
Returns the value of attribute input
447 448 449 |
# File 'lib/agent_cli_runtime/values.rb', line 447 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output
447 448 449 |
# File 'lib/agent_cli_runtime/values.rb', line 447 def output @output end |
#reasoning ⇒ Object (readonly)
Returns the value of attribute reasoning
447 448 449 |
# File 'lib/agent_cli_runtime/values.rb', line 447 def reasoning @reasoning end |
Instance Method Details
#cached ⇒ Object
462 463 464 465 466 |
# File 'lib/agent_cli_runtime/values.rb', line 462 def cached return nil if cache_read.nil? || cache_write.nil? cache_read + cache_write end |