Class: RubyLLM::Accounting::Usage

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/accounting/usage.rb

Overview

Internal accounting for physical provider attempts.

Defined Under Namespace

Modules: Result Classes: Entry, Tracker

Class Method Summary collapse

Class Method Details

.instrument(entry, config:) ⇒ Object

:nodoc: all



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ruby_llm/accounting/usage.rb', line 9

def self.instrument(entry, config:) # :nodoc:
  RubyLLM.instrument(
    'usage.ruby_llm',
    {
      operation: entry.operation,
      provider: entry.provider,
      model: entry.model,
      status: entry.status,
      tokens: entry.tokens,
      cost: entry.cost
    },
    config:
  )
end