Class: Cadenya::Resources::Agents
- Inherits:
-
Object
- Object
- Cadenya::Resources::Agents
- Defined in:
- lib/cadenya/resources/agents.rb,
lib/cadenya/resources/agents/feedback.rb,
lib/cadenya/resources/agents/schedules.rb,
lib/cadenya/resources/agents/variations.rb,
lib/cadenya/resources/agents/webhook_deliveries.rb,
sig/cadenya/resources/agents.rbs,
sig/cadenya/resources/agents/feedback.rbs,
sig/cadenya/resources/agents/schedules.rbs,
sig/cadenya/resources/agents/variations.rbs,
sig/cadenya/resources/agents/webhook_deliveries.rbs
Overview
Manage AI agents within a workspace. Agents define AI behavior and tool access.
Defined Under Namespace
Classes: Feedback, Schedules, Variations, WebhookDeliveries
Instance Attribute Summary collapse
-
#feedback ⇒ Cadenya::Resources::Agents::Feedback
readonly
Manage AI agents within a workspace.
-
#schedules ⇒ Cadenya::Resources::Agents::Schedules
readonly
Manage recurring schedules attached to agents.
-
#variations ⇒ Cadenya::Resources::Agents::Variations
readonly
Manage variations of an agent and their tool, sub-agent, and memory layer assignments.
-
#webhook_deliveries ⇒ Cadenya::Resources::Agents::WebhookDeliveries
readonly
Manage AI agents within a workspace.
Instance Method Summary collapse
-
#archive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentArchiveParams for more details.
-
#create(metadata:, spec:, workspace_id: nil, default_variation: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentCreateParams for more details.
-
#delete(id, workspace_id: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::AgentDeleteParams for more details.
-
#initialize(client:) ⇒ Agents
constructor
private
A new instance of Agents.
-
#list(workspace_id: nil, cursor: nil, include_info: nil, labels: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, state: nil, variation_selection_mode: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Agent>
Some parameter documentations has been truncated, see Models::AgentListParams for more details.
-
#publish(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentPublishParams for more details.
-
#retrieve(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentRetrieveParams for more details.
-
#unarchive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentUnarchiveParams for more details.
-
#unpublish(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentUnpublishParams for more details.
-
#update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Agents
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Agents.
337 338 339 340 341 342 343 |
# File 'lib/cadenya/resources/agents.rb', line 337 def initialize(client:) @client = client @feedback = Cadenya::Resources::Agents::Feedback.new(client: client) @webhook_deliveries = Cadenya::Resources::Agents::WebhookDeliveries.new(client: client) @variations = Cadenya::Resources::Agents::Variations.new(client: client) @schedules = Cadenya::Resources::Agents::Schedules.new(client: client) end |
Instance Attribute Details
#feedback ⇒ Cadenya::Resources::Agents::Feedback (readonly)
Manage AI agents within a workspace. Agents define AI behavior and tool access.
9 10 11 |
# File 'lib/cadenya/resources/agents.rb', line 9 def feedback @feedback end |
#schedules ⇒ Cadenya::Resources::Agents::Schedules (readonly)
Manage recurring schedules attached to agents. Schedules trigger objectives on a cadence defined by AgentScheduleSpec.Schedule.
23 24 25 |
# File 'lib/cadenya/resources/agents.rb', line 23 def schedules @schedules end |
#variations ⇒ Cadenya::Resources::Agents::Variations (readonly)
Manage variations of an agent and their tool, sub-agent, and memory layer assignments.
18 19 20 |
# File 'lib/cadenya/resources/agents.rb', line 18 def variations @variations end |
#webhook_deliveries ⇒ Cadenya::Resources::Agents::WebhookDeliveries (readonly)
Manage AI agents within a workspace. Agents define AI behavior and tool access.
13 14 15 |
# File 'lib/cadenya/resources/agents.rb', line 13 def webhook_deliveries @webhook_deliveries end |
Instance Method Details
#archive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentArchiveParams for more details.
Transitions an agent to STATE_ARCHIVED. Archived agents are hidden from list results and cannot be used for objectives; active schedules are paused.
227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/cadenya/resources/agents.rb', line 227 def archive(id, params = {}) parsed, = Cadenya::AgentArchiveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/agents/%2$s:archive", workspace_id, id], model: Cadenya::Agent, options: ) end |
#create(metadata:, spec:, workspace_id: nil, default_variation: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentCreateParams for more details.
Creates a new agent in the workspace
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cadenya/resources/agents.rb', line 45 def create(params) parsed, = Cadenya::AgentCreateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/agents", workspace_id], body: parsed, model: Cadenya::Agent, options: ) end |
#delete(id, workspace_id: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::AgentDeleteParams for more details.
Deletes an agent from the workspace
196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/cadenya/resources/agents.rb', line 196 def delete(id, params = {}) parsed, = Cadenya::AgentDeleteParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :delete, path: ["v1/workspaces/%1$s/agents/%2$s", workspace_id, id], model: NilClass, options: ) end |
#list(workspace_id: nil, cursor: nil, include_info: nil, labels: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, state: nil, variation_selection_mode: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Agent>
Some parameter documentations has been truncated, see Models::AgentListParams for more details.
Lists all agents in the workspace
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/cadenya/resources/agents.rb', line 159 def list(params = {}) parsed, = Cadenya::AgentListParams.dump_request(params) query = Cadenya::Internal::Util.encode_query_params(parsed) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :get, path: ["v1/workspaces/%1$s/agents", workspace_id], query: query.transform_keys( include_info: "includeInfo", sort_order: "sortOrder", variation_selection_mode: "variationSelectionMode" ), page: Cadenya::Internal::CursorPagination, model: Cadenya::Agent, options: ) end |
#publish(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentPublishParams for more details.
Transitions an agent to STATE_PUBLISHED, making it available for objectives. The agent must have at least one variation.
258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/cadenya/resources/agents.rb', line 258 def publish(id, params = {}) parsed, = Cadenya::AgentPublishParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/agents/%2$s:publish", workspace_id, id], model: Cadenya::Agent, options: ) end |
#retrieve(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentRetrieveParams for more details.
Retrieves an agent by ID from the workspace
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cadenya/resources/agents.rb', line 76 def retrieve(id, params = {}) parsed, = Cadenya::AgentRetrieveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :get, path: ["v1/workspaces/%1$s/agents/%2$s", workspace_id, id], model: Cadenya::Agent, options: ) end |
#unarchive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentUnarchiveParams for more details.
Transitions an archived agent back to STATE_DRAFT. Publish the agent again to make it available for objectives.
289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/cadenya/resources/agents.rb', line 289 def unarchive(id, params = {}) parsed, = Cadenya::AgentUnarchiveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/agents/%2$s:unarchive", workspace_id, id], model: Cadenya::Agent, options: ) end |
#unpublish(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentUnpublishParams for more details.
Transitions a published agent back to STATE_DRAFT. Active schedules for the agent are paused until it is published again.
320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/cadenya/resources/agents.rb', line 320 def unpublish(id, params = {}) parsed, = Cadenya::AgentUnpublishParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/agents/%2$s:unpublish", workspace_id, id], model: Cadenya::Agent, options: ) end |
#update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentUpdateParams for more details.
Updates an agent in the workspace
112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/cadenya/resources/agents.rb', line 112 def update(id, params = {}) parsed, = Cadenya::AgentUpdateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :patch, path: ["v1/workspaces/%1$s/agents/%2$s", workspace_id, id], body: parsed, model: Cadenya::Agent, options: ) end |