Class: LlmCostTracker::Dashboard::PricingOverview

Inherits:
Object
  • Object
show all
Defined in:
app/services/llm_cost_tracker/dashboard/pricing_overview.rb

Defined Under Namespace

Classes: Row

Constant Summary collapse

SOURCES =
%i[overrides file bundled].freeze
RATE_COLUMNS =
%i[input output cache_read_input cache_write_input batch_input batch_output].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.callObject



11
12
13
# File 'app/services/llm_cost_tracker/dashboard/pricing_overview.rb', line 11

def call
  new.call
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
23
24
25
# File 'app/services/llm_cost_tracker/dashboard/pricing_overview.rb', line 16

def call
  sources = SOURCES.each_with_object({}) do |source, acc|
    built = build_source(source)
    acc[source] = built if built
  end
  {
    sources: sources,
    effective_source: sources.keys.first || :bundled
  }
end