Class: LlmCostTracker::Usage::Dimension
- Inherits:
-
Data
- Object
- Data
- LlmCostTracker::Usage::Dimension
- Defined in:
- lib/llm_cost_tracker/usage/dimension.rb
Instance Attribute Summary collapse
-
#cache_state ⇒ Object
readonly
Returns the value of attribute cache_state.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#modality ⇒ Object
readonly
Returns the value of attribute modality.
-
#rate_basis ⇒ Object
readonly
Returns the value of attribute rate_basis.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
Instance Attribute Details
#cache_state ⇒ Object (readonly)
Returns the value of attribute cache_state
5 6 7 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 5 def cache_state @cache_state end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction
5 6 7 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 5 def direction @direction end |
#key ⇒ Object (readonly)
Returns the value of attribute key
5 6 7 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 5 def key @key end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
5 6 7 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 5 def kind @kind end |
#modality ⇒ Object (readonly)
Returns the value of attribute modality
5 6 7 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 5 def modality @modality end |
#rate_basis ⇒ Object (readonly)
Returns the value of attribute rate_basis
5 6 7 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 5 def rate_basis @rate_basis end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit
5 6 7 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 5 def unit @unit end |
Instance Method Details
#cost_key ⇒ Object
16 17 18 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 16 def cost_key :"#{key}_cost" if token? end |
#token? ⇒ Boolean
8 9 10 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 8 def token? unit == "token" end |
#token_key ⇒ Object
12 13 14 |
# File 'lib/llm_cost_tracker/usage/dimension.rb', line 12 def token_key :"#{key}_tokens" if token? end |