Class: RubyLLM::Ups::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/ups/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



9
10
11
12
# File 'lib/ruby_llm/ups/client.rb', line 9

def initialize(config)
  @config = config
  @config.validate!
end

Instance Method Details

#create_component(name:, component_type: "agent", **attrs) ⇒ Object



21
22
23
# File 'lib/ruby_llm/ups/client.rb', line 21

def create_component(name:, component_type: "agent", **attrs)
  post("components", component: { name: name, component_type: component_type, **attrs })
end

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



29
30
31
32
33
34
35
36
# File 'lib/ruby_llm/ups/client.rb', line 29

def create_incident(title:, impact:, status: :investigating, **attrs)
  post("incidents", incident: {
    title: title,
    impact: impact,
    status: status,
    **attrs
  })
end

#list_components ⇒ Object



25
26
27
# File 'lib/ruby_llm/ups/client.rb', line 25

def list_components
  get("components")
end

#resolve_incident(id) ⇒ Object



42
43
44
# File 'lib/ruby_llm/ups/client.rb', line 42

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

#update_component(component_id, status:, agent_metadata: {}) ⇒ Object



14
15
16
17
18
19
# File 'lib/ruby_llm/ups/client.rb', line 14

def update_component(component_id, status:, agent_metadata: {})
  patch("components/#{component_id}", component: {
    status: status,
    agent_metadata: 
  })
end

#update_incident(id, **attrs) ⇒ Object



38
39
40
# File 'lib/ruby_llm/ups/client.rb', line 38

def update_incident(id, **attrs)
  patch("incidents/#{id}", incident: attrs)
end