Exception: LlmCostTracker::BudgetExceededError
- Defined in:
- lib/llm_cost_tracker/errors.rb
Instance Attribute Summary collapse
-
#budget ⇒ Object
readonly
Returns the value of attribute budget.
-
#last_event ⇒ Object
readonly
Returns the value of attribute last_event.
-
#monthly_total ⇒ Object
readonly
Returns the value of attribute monthly_total.
Instance Method Summary collapse
-
#initialize(monthly_total:, budget:, last_event: nil) ⇒ BudgetExceededError
constructor
A new instance of BudgetExceededError.
Constructor Details
#initialize(monthly_total:, budget:, last_event: nil) ⇒ BudgetExceededError
Returns a new instance of BudgetExceededError.
9 10 11 12 13 14 15 |
# File 'lib/llm_cost_tracker/errors.rb', line 9 def initialize(monthly_total:, budget:, last_event: nil) @monthly_total = monthly_total @budget = budget @last_event = last_event super("LLM monthly budget exceeded: $#{format('%.6f', monthly_total)} / $#{format('%.6f', budget)}") end |
Instance Attribute Details
#budget ⇒ Object (readonly)
Returns the value of attribute budget.
7 8 9 |
# File 'lib/llm_cost_tracker/errors.rb', line 7 def budget @budget end |
#last_event ⇒ Object (readonly)
Returns the value of attribute last_event.
7 8 9 |
# File 'lib/llm_cost_tracker/errors.rb', line 7 def last_event @last_event end |
#monthly_total ⇒ Object (readonly)
Returns the value of attribute monthly_total.
7 8 9 |
# File 'lib/llm_cost_tracker/errors.rb', line 7 def monthly_total @monthly_total end |