Module: LlmCostTracker::Storage::LogBackend
- Defined in:
- lib/llm_cost_tracker/storage/log_backend.rb
Class Method Summary collapse
Class Method Details
.save(event, config:) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/llm_cost_tracker/storage/log_backend.rb', line 9 def save(event, config:) = "#{event.provider}/#{event.model} " \ "tokens=#{event.input_tokens}+#{event.output_tokens} " \ "cost=#{cost_label(event)}" += " latency=#{event.latency_ms}ms" if event.latency_ms += " tags=#{event.}" unless event..empty? Logging.log(config.log_level, ) event end |