Class: LlmCostTracker::UnknownPricing

Inherits:
Object
  • Object
show all
Defined in:
lib/llm_cost_tracker/unknown_pricing.rb

Constant Summary collapse

MUTEX =
Monitor.new

Class Method Summary collapse

Class Method Details

.handle!(model) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/llm_cost_tracker/unknown_pricing.rb', line 12

def handle!(model)
  model = normalized_model_name(model)

  case behavior
  when :ignore
    nil
  when :warn
    warn_missing(model)
  when :raise
    raise UnknownPricingError.new(model: model)
  end
end

.reset!Object



25
26
27
# File 'lib/llm_cost_tracker/unknown_pricing.rb', line 25

def reset!
  MUTEX.synchronize { @warned_models = Set.new }
end