Class: LlmCostTracker::LlmApiCall

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
LlmApiCallMetrics, PeriodGrouping, TagsColumn
Includes:
TagAccessors
Defined in:
lib/llm_cost_tracker/llm_api_call.rb

Constant Summary

Constants included from TagsColumn

TagsColumn::USAGE_BREAKDOWN_COLUMNS, TagsColumn::USAGE_BREAKDOWN_COST_COLUMNS

Class Method Summary collapse

Methods included from PeriodGrouping

daily_costs, group_by_period

Methods included from TagsColumn

latency_column?, pricing_mode_column?, provider_response_id_column?, reset_column_information, stream_column?, tags_json_column?, tags_jsonb_column?, tags_mysql_json_column?, usage_breakdown_columns?, usage_breakdown_cost_columns?, usage_source_column?

Methods included from LlmApiCallMetrics

average_latency_ms, cost_by_model, cost_by_provider, cost_by_tag, group_by_tag, latency_by_model, latency_by_provider, tag_value_expression, tag_value_label, total_cost, total_tokens

Methods included from TagAccessors

#parsed_tags

Class Method Details

.by_tag(key, value) ⇒ Object



52
53
54
# File 'lib/llm_cost_tracker/llm_api_call.rb', line 52

def self.by_tag(key, value)
  by_tags(key => value)
end

.by_tags(tags) ⇒ Object



56
57
58
# File 'lib/llm_cost_tracker/llm_api_call.rb', line 56

def self.by_tags(tags)
  TagQuery.apply(self, tags)
end