Exception: RubyLLM::Agents::Reliability::BudgetExceededError
- Inherits:
-
Error
- Object
- StandardError
- Error
- RubyLLM::Agents::Reliability::BudgetExceededError
- Defined in:
- lib/ruby_llm/agents/infrastructure/reliability.rb
Overview
Raised when budget limits have been exceeded
Instance Attribute Summary collapse
- #agent_type ⇒ Object readonly
- #current ⇒ Object readonly
- #limit ⇒ Object readonly
- #scope ⇒ Object readonly
- #tenant_id ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(scope, limit, current, agent_type: nil, tenant_id: nil) ⇒ BudgetExceededError
constructor
A new instance of BudgetExceededError.
Constructor Details
#initialize(scope, limit, current, agent_type: nil, tenant_id: nil) ⇒ BudgetExceededError
Returns a new instance of BudgetExceededError.
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 57 def initialize(scope, limit, current, agent_type: nil, tenant_id: nil) @scope = scope @limit = limit @current = current @agent_type = agent_type @tenant_id = tenant_id = "Budget exceeded for #{scope}" += " (tenant: #{tenant_id})" if tenant_id += " (#{agent_type})" if agent_type += ": limit $#{limit}, current $#{current}" super() end |
Instance Attribute Details
#agent_type ⇒ Object (readonly)
50 51 52 |
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 50 def agent_type @agent_type end |
#current ⇒ Object (readonly)
50 51 52 |
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 50 def current @current end |
#limit ⇒ Object (readonly)
50 51 52 |
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 50 def limit @limit end |
#scope ⇒ Object (readonly)
50 51 52 |
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 50 def scope @scope end |
#tenant_id ⇒ Object (readonly)
50 51 52 |
# File 'lib/ruby_llm/agents/infrastructure/reliability.rb', line 50 def tenant_id @tenant_id end |