Class: LlmCostTracker::PriceSync::RawPrice
- Inherits:
-
Data
- Object
- Data
- LlmCostTracker::PriceSync::RawPrice
- Defined in:
- lib/llm_cost_tracker/price_sync/raw_price.rb,
lib/llm_cost_tracker/price_sync/raw_price.rb
Constant Summary collapse
- PRICE_FIELDS =
%w[input output cached_input cache_read_input cache_creation_input].freeze
Instance Attribute Summary collapse
-
#cache_creation_input ⇒ Object
readonly
Returns the value of attribute cache_creation_input.
-
#cache_read_input ⇒ Object
readonly
Returns the value of attribute cache_read_input.
-
#cached_input ⇒ Object
readonly
Returns the value of attribute cached_input.
-
#fetched_at ⇒ Object
readonly
Returns the value of attribute fetched_at.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#source_version ⇒ Object
readonly
Returns the value of attribute source_version.
Instance Method Summary collapse
Instance Attribute Details
#cache_creation_input ⇒ Object (readonly)
Returns the value of attribute cache_creation_input
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def cache_creation_input @cache_creation_input end |
#cache_read_input ⇒ Object (readonly)
Returns the value of attribute cache_read_input
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def cache_read_input @cache_read_input end |
#cached_input ⇒ Object (readonly)
Returns the value of attribute cached_input
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def cached_input @cached_input end |
#fetched_at ⇒ Object (readonly)
Returns the value of attribute fetched_at
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def fetched_at @fetched_at end |
#input ⇒ Object (readonly)
Returns the value of attribute input
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def input @input end |
#model ⇒ Object (readonly)
Returns the value of attribute model
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def model @model end |
#output ⇒ Object (readonly)
Returns the value of attribute output
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def output @output end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def provider @provider end |
#source ⇒ Object (readonly)
Returns the value of attribute source
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def source @source end |
#source_version ⇒ Object (readonly)
Returns the value of attribute source_version
5 6 7 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 5 def source_version @source_version end |
Instance Method Details
#to_registry_entry(today:) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/llm_cost_tracker/price_sync/raw_price.rb', line 21 def to_registry_entry(today:) { "input" => input, "output" => output, "cached_input" => cached_input, "cache_read_input" => cache_read_input, "cache_creation_input" => cache_creation_input, "_source" => source.to_s, "_source_version" => source_version, "_fetched_at" => fetched_at || today.iso8601 }.compact end |