Module: RubyLLM::Agents::AlertManager
- Defined in:
- lib/ruby_llm/agents/infrastructure/alert_manager.rb
Overview
Alert notification dispatcher for governance events
Sends notifications via user-provided handler and ActiveSupport::Notifications when important events occur like budget exceedance or circuit breaker activation.
Class Method Summary collapse
-
.notify(event, payload) ⇒ void
Sends a notification to the configured handler and emits AS::N.
Class Method Details
.notify(event, payload) ⇒ void
This method returns an undefined value.
Sends a notification to the configured handler and emits AS::N
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ruby_llm/agents/infrastructure/alert_manager.rb', line 35 def notify(event, payload) full_payload = build_payload(event, payload) # Call user-provided handler (if set) call_handler(event, full_payload) # Always emit ActiveSupport::Notification emit_notification(event, full_payload) # Store in cache for dashboard display store_for_dashboard(event, full_payload) rescue => e Rails.logger.error("[RubyLLM::Agents::AlertManager] Failed: #{e.}") end |