Class: Oz::Resources::Runs
Overview
Operations on individual agent runs, reachable via client.agent.runs.
Instance Method Summary collapse
-
#cancel(run_id) ⇒ String
Cancel a run that is in progress.
-
#list(**params) ⇒ Oz::CursorPage
List runs with optional filters.
-
#list_handoff_attachments(run_id) ⇒ Oz::Model
List the attachments produced by a run’s handoff.
-
#retrieve(run_id) ⇒ Oz::Model
Retrieve a single run by id.
-
#submit_followup(run_id, message: nil, mode: nil) ⇒ Oz::Model
Send a follow-up message to a run (e.g. to answer a blocking question or continue the conversation).
Methods inherited from Base
Constructor Details
This class inherits a constructor from Oz::Resources::Base
Instance Method Details
#cancel(run_id) ⇒ String
Cancel a run that is in progress.
32 33 34 |
# File 'lib/oz/resources/runs.rb', line 32 def cancel(run_id) @client.post("/agent/runs/#{enc(run_id)}/cancel") end |
#list(**params) ⇒ Oz::CursorPage
List runs with optional filters. Returns a cursor-paginated page.
Supported filters include: ancestor_run_id, artifact_type, created_after, created_before, creator, cursor, environment_id, execution_location, executor, limit, model_id, name, q, schedule_id, skill, skill_spec, sort_by, sort_order, source, state (an Array of states), and updated_after.
Time-like filters accept either an ISO-8601 String or a Time/Date.
24 25 26 27 |
# File 'lib/oz/resources/runs.rb', line 24 def list(**params) body = @client.get('/agent/runs', query: params) Oz::CursorPage.new(body, resource: self, params: params, items_key: 'runs') end |
#list_handoff_attachments(run_id) ⇒ Oz::Model
List the attachments produced by a run’s handoff.
39 40 41 |
# File 'lib/oz/resources/runs.rb', line 39 def (run_id) model(@client.get("/agent/runs/#{enc(run_id)}/handoff/attachments")) end |
#retrieve(run_id) ⇒ Oz::Model
Retrieve a single run by id.
10 11 12 |
# File 'lib/oz/resources/runs.rb', line 10 def retrieve(run_id) model(@client.get("/agent/runs/#{enc(run_id)}")) end |
#submit_followup(run_id, message: nil, mode: nil) ⇒ Oz::Model
Send a follow-up message to a run (e.g. to answer a blocking question or continue the conversation).
49 50 51 52 |
# File 'lib/oz/resources/runs.rb', line 49 def submit_followup(run_id, message: nil, mode: nil) body = compact(message: , mode: mode) model(@client.post("/agent/runs/#{enc(run_id)}/followups", body: body)) end |