Class: LlmCostTracker::Event
- Inherits:
-
Data
- Object
- Data
- LlmCostTracker::Event
- Defined in:
- lib/llm_cost_tracker/event.rb
Instance Attribute Summary collapse
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#input_tokens ⇒ Object
readonly
Returns the value of attribute input_tokens.
-
#latency_ms ⇒ Object
readonly
Returns the value of attribute latency_ms.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#output_tokens ⇒ Object
readonly
Returns the value of attribute output_tokens.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#total_tokens ⇒ Object
readonly
Returns the value of attribute total_tokens.
-
#tracked_at ⇒ Object
readonly
Returns the value of attribute tracked_at.
Instance Method Summary collapse
Instance Attribute Details
#cost ⇒ Object (readonly)
Returns the value of attribute cost
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def cost @cost end |
#input_tokens ⇒ Object (readonly)
Returns the value of attribute input_tokens
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def input_tokens @input_tokens end |
#latency_ms ⇒ Object (readonly)
Returns the value of attribute latency_ms
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def latency_ms @latency_ms end |
#model ⇒ Object (readonly)
Returns the value of attribute model
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def model @model end |
#output_tokens ⇒ Object (readonly)
Returns the value of attribute output_tokens
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def output_tokens @output_tokens end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def provider @provider end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def @tags end |
#total_tokens ⇒ Object (readonly)
Returns the value of attribute total_tokens
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def total_tokens @total_tokens end |
#tracked_at ⇒ Object (readonly)
Returns the value of attribute tracked_at
4 5 6 |
# File 'lib/llm_cost_tracker/event.rb', line 4 def tracked_at @tracked_at end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 |
# File 'lib/llm_cost_tracker/event.rb', line 15 def to_h super.merge( cost: cost&.to_h, tags: ? .to_h : {} ) end |