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
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
-
#create(workspace_id, metadata:, spec:, default_variation: nil, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentCreateParams for more details.
-
#delete(id, workspace_id:, 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, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, status: 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.
-
#retrieve(id, workspace_id:, request_options: {}) ⇒ Cadenya::Models::Agent
Some parameter documentations has been truncated, see Models::AgentRetrieveParams for more details.
-
#update(id, workspace_id:, 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.
206 207 208 209 210 211 212 |
# File 'lib/cadenya/resources/agents.rb', line 206 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
#create(workspace_id, metadata:, spec:, 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 |
# File 'lib/cadenya/resources/agents.rb', line 45 def create(workspace_id, params) parsed, = Cadenya::AgentCreateParams.dump_request(params) @client.request( method: :post, path: ["v1/workspaces/%1$s/agents", workspace_id], body: parsed, model: Cadenya::Agent, options: ) end |
#delete(id, workspace_id:, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::AgentDeleteParams for more details.
Deletes an agent from the workspace
189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/cadenya/resources/agents.rb', line 189 def delete(id, params) parsed, = Cadenya::AgentDeleteParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["v1/workspaces/%1$s/agents/%2$s", workspace_id, id], model: NilClass, options: ) end |
#list(workspace_id, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, status: 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
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/cadenya/resources/agents.rb', line 155 def list(workspace_id, params = {}) parsed, = Cadenya::AgentListParams.dump_request(params) query = Cadenya::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/workspaces/%1$s/agents", workspace_id], query: query.transform_keys( bundle_key: "bundleKey", include_info: "includeInfo", sort_order: "sortOrder", variation_selection_mode: "variationSelectionMode" ), page: Cadenya::Internal::CursorPagination, model: Cadenya::Agent, options: ) end |
#retrieve(id, workspace_id:, 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
72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/cadenya/resources/agents.rb', line 72 def retrieve(id, params) parsed, = Cadenya::AgentRetrieveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/workspaces/%1$s/agents/%2$s", workspace_id, id], model: Cadenya::Agent, options: ) end |
#update(id, workspace_id:, 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
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/cadenya/resources/agents.rb', line 108 def update(id, params) parsed, = Cadenya::AgentUpdateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["v1/workspaces/%1$s/agents/%2$s", workspace_id, id], body: parsed, model: Cadenya::Agent, options: ) end |