Class: Oz::Resources::Agent
Overview
Entry point for running and managing cloud agents, reachable via client.agent. Sub-resources hang off it: #runs, #schedules, #identities, #sessions, and #conversations.
Instance Method Summary collapse
- #conversations ⇒ Oz::Resources::Conversations
-
#get_artifact(artifact_uid) ⇒ Oz::Model
Retrieve an artifact produced by a run (plan, screenshot, or file).
- #identities ⇒ Oz::Resources::Identities
-
#list(include_malformed_skills: nil, refresh: nil, repo: nil, sort_by: nil, **extra) ⇒ Oz::Model
List available agents (skills) across accessible environments.
-
#list_environments(sort_by: nil, **extra) ⇒ Oz::Model
List cloud environments available to the caller.
-
#run(prompt: nil, config: nil, conversation_id: nil, attachments: nil, interactive: nil, mode: nil, parent_run_id: nil, skill: nil, team: nil, title: nil, agent_identity_uid: nil, **extra) ⇒ Oz::Model
Start a new agent run.
- #runs ⇒ Oz::Resources::Runs
- #schedules ⇒ Oz::Resources::Schedules
- #sessions ⇒ Oz::Resources::Sessions
Methods inherited from Base
Constructor Details
This class inherits a constructor from Oz::Resources::Base
Instance Method Details
#conversations ⇒ Oz::Resources::Conversations
90 91 92 |
# File 'lib/oz/resources/agent.rb', line 90 def conversations @conversations ||= Conversations.new(@client) end |
#get_artifact(artifact_uid) ⇒ Oz::Model
Retrieve an artifact produced by a run (plan, screenshot, or file).
57 58 59 |
# File 'lib/oz/resources/agent.rb', line 57 def get_artifact(artifact_uid) model(@client.get("/agent/artifacts/#{enc(artifact_uid)}")) end |
#identities ⇒ Oz::Resources::Identities
80 81 82 |
# File 'lib/oz/resources/agent.rb', line 80 def identities @identities ||= Identities.new(@client) end |
#list(include_malformed_skills: nil, refresh: nil, repo: nil, sort_by: nil, **extra) ⇒ Oz::Model
List available agents (skills) across accessible environments.
46 47 48 49 50 51 52 |
# File 'lib/oz/resources/agent.rb', line 46 def list(include_malformed_skills: nil, refresh: nil, repo: nil, sort_by: nil, **extra) query = compact( include_malformed_skills: include_malformed_skills, refresh: refresh, repo: repo, sort_by: sort_by ).merge(extra) model(@client.get('/agent', query: query)) end |
#list_environments(sort_by: nil, **extra) ⇒ Oz::Model
List cloud environments available to the caller.
64 65 66 67 |
# File 'lib/oz/resources/agent.rb', line 64 def list_environments(sort_by: nil, **extra) query = compact(sort_by: sort_by).merge(extra) model(@client.get('/agent/environments', query: query)) end |
#run(prompt: nil, config: nil, conversation_id: nil, attachments: nil, interactive: nil, mode: nil, parent_run_id: nil, skill: nil, team: nil, title: nil, agent_identity_uid: nil, **extra) ⇒ Oz::Model
Start a new agent run.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/oz/resources/agent.rb', line 28 def run(prompt: nil, config: nil, conversation_id: nil, attachments: nil, interactive: nil, mode: nil, parent_run_id: nil, skill: nil, team: nil, title: nil, agent_identity_uid: nil, **extra) body = compact( prompt: prompt, config: config, conversation_id: conversation_id, attachments: , interactive: interactive, mode: mode, parent_run_id: parent_run_id, skill: skill, team: team, title: title, agent_identity_uid: agent_identity_uid ).merge(extra) model(@client.post('/agent/runs', body: body)) end |
#runs ⇒ Oz::Resources::Runs
70 71 72 |
# File 'lib/oz/resources/agent.rb', line 70 def runs @runs ||= Runs.new(@client) end |
#schedules ⇒ Oz::Resources::Schedules
75 76 77 |
# File 'lib/oz/resources/agent.rb', line 75 def schedules @schedules ||= Schedules.new(@client) end |
#sessions ⇒ Oz::Resources::Sessions
85 86 87 |
# File 'lib/oz/resources/agent.rb', line 85 def sessions @sessions ||= Sessions.new(@client) end |