Class: LlmCostTracker::Configuration::Capture

Inherits:
Section
  • Object
show all
Defined in:
lib/llm_cost_tracker/configuration/capture.rb

Constant Summary collapse

OPENAI_COMPATIBLE_PROVIDERS =
{
  "openrouter.ai" => "openrouter",
  "api.deepseek.com" => "deepseek",
  "api.groq.com" => "groq"
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Section

attributes, enum_attribute

Constructor Details

#initialize(owner) ⇒ Capture

Returns a new instance of Capture.



18
19
20
21
22
# File 'lib/llm_cost_tracker/configuration/capture.rb', line 18

def initialize(owner)
  super
  @request_stream_usage = true
  self.openai_compatible_providers = OPENAI_COMPATIBLE_PROVIDERS
end

Instance Attribute Details

#openai_compatible_providersObject

Returns the value of attribute openai_compatible_providers.



16
17
18
# File 'lib/llm_cost_tracker/configuration/capture.rb', line 16

def openai_compatible_providers
  @openai_compatible_providers
end

Instance Method Details

#finalize!Object



29
30
31
# File 'lib/llm_cost_tracker/configuration/capture.rb', line 29

def finalize!
  @openai_compatible_providers = deep_freeze(normalize_providers(@openai_compatible_providers))
end