Module: LlmCostTracker::PriceSync::RegistryDiff

Defined in:
lib/llm_cost_tracker/price_sync/registry_diff.rb

Class Method Summary collapse

Class Method Details

.call(current_models, updated_models) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/llm_cost_tracker/price_sync/registry_diff.rb', line 7

def call(current_models, updated_models)
  current_models = normalize_models(current_models)
  updated_models = normalize_models(updated_models)

  (current_models.keys | updated_models.keys).sort.each_with_object({}) do |model, changes|
    fields = price_field_changes(current_models[model], updated_models[model])
    changes[model] = fields if fields.any?
  end
end