Module: LlmCostTracker::Pricing::Unknown

Defined in:
lib/llm_cost_tracker/pricing/unknown.rb

Constant Summary collapse

MUTEX =
Mutex.new
WARN_CACHE_LIMIT =
1024

Class Method Summary collapse

Class Method Details

.process(model, pricing_mode: nil) ⇒ Object



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

def process(model, pricing_mode: nil)
  model = model.to_s.presence || Event::UNKNOWN_MODEL

  case LlmCostTracker.configuration.pricing.unknown_model_behavior
  when :ignore
    nil
  when :warn
    warn_missing(model, pricing_mode.to_s.presence)
  when :raise
    raise UnknownPricingError.new(model: model)
  end
end