Module: RubyLLM::Ups::IncidentMethods

Defined in:
lib/ruby_llm/ups/incident_methods.rb

Instance Method Summary collapse

Instance Method Details

#create_incident(title:, impact:, status: :investigating, **attrs) ⇒ Object



6
7
8
9
10
11
# File 'lib/ruby_llm/ups/incident_methods.rb', line 6

def create_incident(title:, impact:, status: :investigating, **attrs)
  meta = _ups_monitor.
  meta[:component_id] ||= _ups_monitor.component_id
  _ups_monitor.client.create_incident(title: title, impact: impact, status: status,
                                      agent_metadata: meta, **attrs)
end

#resolve_incident(id) ⇒ Object



19
20
21
# File 'lib/ruby_llm/ups/incident_methods.rb', line 19

def resolve_incident(id)
  update_incident(id, status: :resolved)
end

#update_incident(id, **attrs) ⇒ Object



13
14
15
16
17
# File 'lib/ruby_llm/ups/incident_methods.rb', line 13

def update_incident(id, **attrs)
  caller_meta = attrs.delete(:agent_metadata) || {}
  meta = _ups_monitor..merge(caller_meta)
  _ups_monitor.client.update_incident(id, agent_metadata: meta, **attrs)
end