Class: LlmCostTracker::Pricing::Explanation
- Inherits:
-
Data
- Object
- Data
- LlmCostTracker::Pricing::Explanation
- Defined in:
- lib/llm_cost_tracker/pricing/explainer.rb
Instance Attribute Summary collapse
-
#effective_prices ⇒ Object
readonly
Returns the value of attribute effective_prices.
-
#matched_by ⇒ Object
readonly
Returns the value of attribute matched_by.
-
#matched_key ⇒ Object
readonly
Returns the value of attribute matched_key.
-
#missing_price_keys ⇒ Object
readonly
Returns the value of attribute missing_price_keys.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#prices ⇒ Object
readonly
Returns the value of attribute prices.
-
#pricing_mode ⇒ Object
readonly
Returns the value of attribute pricing_mode.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
Instance Attribute Details
#effective_prices ⇒ Object (readonly)
Returns the value of attribute effective_prices
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def effective_prices @effective_prices end |
#matched_by ⇒ Object (readonly)
Returns the value of attribute matched_by
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def matched_by @matched_by end |
#matched_key ⇒ Object (readonly)
Returns the value of attribute matched_key
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def matched_key @matched_key end |
#missing_price_keys ⇒ Object (readonly)
Returns the value of attribute missing_price_keys
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def missing_price_keys @missing_price_keys end |
#model ⇒ Object (readonly)
Returns the value of attribute model
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def model @model end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def prices @prices end |
#pricing_mode ⇒ Object (readonly)
Returns the value of attribute pricing_mode
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def pricing_mode @pricing_mode end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def provider @provider end |
#source ⇒ Object (readonly)
Returns the value of attribute source
7 8 9 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 7 def source @source end |
Instance Method Details
#complete? ⇒ Boolean
20 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 20 def complete? = matched? && missing_price_keys.empty? |
#matched? ⇒ Boolean
18 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 18 def matched? = !prices.nil? |
#message ⇒ Object
22 23 24 25 26 27 |
# File 'lib/llm_cost_tracker/pricing/explainer.rb', line 22 def return "No price entry matched #{provider}/#{model}" unless matched? return "Matched #{matched_key} from #{source} via #{matched_by}" if complete? "Matched #{matched_key} from #{source} via #{matched_by}, but missing #{missing_price_keys.join(', ')}" end |