Class: LlmCostTracker::Ledger::Call

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
CallMetrics, Period::Grouping
Includes:
Tags::Accessors
Defined in:
app/models/llm_cost_tracker/ledger/call.rb

Class Method Summary collapse

Methods included from Period::Grouping

daily_costs, group_by_period

Methods included from CallMetrics

average_latency_ms, cost_by_model, cost_by_provider, cost_by_tag, group_by_tag, latency_by_model, latency_by_provider, tag_value_expression, total_cost, total_tokens

Methods included from Tags::Accessors

#parsed_tags

Class Method Details

.by_tag(key, value) ⇒ Object



36
37
38
# File 'app/models/llm_cost_tracker/ledger/call.rb', line 36

def self.by_tag(key, value)
  by_tags(key => value)
end

.by_tags(tags) ⇒ Object



40
41
42
# File 'app/models/llm_cost_tracker/ledger/call.rb', line 40

def self.by_tags(tags)
  Ledger::Tags::Query.apply(self, tags)
end