Module: LlmCostTracker::Ledger::Schema::Calls

Defined in:
lib/llm_cost_tracker/ledger/schema/calls.rb

Constant Summary collapse

CURRENT_SCHEMA_COLUMNS =
%w[
  event_id
  provider
  model
  input_tokens
  output_tokens
  total_tokens
  cache_read_input_tokens
  cache_write_input_tokens
  cache_write_extended_input_tokens
  audio_input_tokens
  audio_output_tokens
  hidden_output_tokens
  total_cost
  latency_ms
  stream
  usage_source
  provider_response_id
  provider_project_id
  provider_api_key_id
  provider_workspace_id
  batch
  pricing_mode
  cost_status
  pricing_snapshot
  tracked_at
].freeze

Class Method Summary collapse

Class Method Details

.current_schema?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/llm_cost_tracker/ledger/schema/calls.rb', line 48

def current_schema?
  current_schema_errors.empty?
end

.current_schema_errorsObject



52
53
54
# File 'lib/llm_cost_tracker/ledger/schema/calls.rb', line 52

def current_schema_errors
  schema_capabilities.fetch(:current_schema_errors)
end

.missing_current_schema_columnsObject



56
57
58
# File 'lib/llm_cost_tracker/ledger/schema/calls.rb', line 56

def missing_current_schema_columns
  schema_capabilities.fetch(:missing_current_schema_columns)
end