Class: LlmCostTracker::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
17
18
19
20
21
22
23
# File 'lib/llm_cost_tracker/configuration.rb', line 14

def initialize
  @enabled            = true
  @storage_backend    = :log
  @custom_storage     = nil
  @default_tags       = {}
  @on_budget_exceeded = nil
  @monthly_budget     = nil
  @log_level          = :info
  @pricing_overrides  = {}
end

Instance Attribute Details

#custom_storageObject

Returns the value of attribute custom_storage.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def custom_storage
  @custom_storage
end

#default_tagsObject

Returns the value of attribute default_tags.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def default_tags
  @default_tags
end

#enabledObject

Returns the value of attribute enabled.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def enabled
  @enabled
end

#log_levelObject

Returns the value of attribute log_level.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def log_level
  @log_level
end

#monthly_budgetObject

Returns the value of attribute monthly_budget.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def monthly_budget
  @monthly_budget
end

#on_budget_exceededObject

Returns the value of attribute on_budget_exceeded.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def on_budget_exceeded
  @on_budget_exceeded
end

#pricing_overridesObject

Returns the value of attribute pricing_overrides.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def pricing_overrides
  @pricing_overrides
end

#storage_backendObject

Returns the value of attribute storage_backend.



5
6
7
# File 'lib/llm_cost_tracker/configuration.rb', line 5

def storage_backend
  @storage_backend
end

Instance Method Details

#active_record?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/llm_cost_tracker/configuration.rb', line 25

def active_record?
  storage_backend == :active_record
end

#log?Boolean

Returns:

  • (Boolean)


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

def log?
  storage_backend == :log
end