Class: Cadenya::Resources::ToolSets
- Inherits:
-
Object
- Object
- Cadenya::Resources::ToolSets
- Defined in:
- lib/cadenya/resources/tool_sets.rb,
lib/cadenya/resources/tool_sets/tools.rb,
lib/cadenya/resources/tool_sets/secrets.rb,
sig/cadenya/resources/tool_sets.rbs,
sig/cadenya/resources/tool_sets/tools.rbs,
sig/cadenya/resources/tool_sets/secrets.rbs
Overview
Manage tool sets and the tools they contain. Tool sets group related tools, and tools define specific capabilities available to agents.
When a tool set is managed, only API key actors can modify its tools; human (profile) actors cannot.
Defined Under Namespace
Instance Attribute Summary collapse
-
#secrets ⇒ Cadenya::Resources::ToolSets::Secrets
readonly
Manage tool sets and the tools they contain.
-
#tools ⇒ Cadenya::Resources::ToolSets::Tools
readonly
Manage tool sets and the tools they contain.
Instance Method Summary collapse
-
#archive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetArchiveParams for more details.
-
#create(metadata:, spec:, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetCreateParams for more details.
-
#delete(id, workspace_id: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ToolSetDeleteParams for more details.
-
#get_openapi_spec(tool_set_id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSetGetOpenAPISpecResponse
Some parameter documentations has been truncated, see Models::ToolSetGetOpenAPISpecParams for more details.
-
#initialize(client:) ⇒ ToolSets
constructor
private
A new instance of ToolSets.
-
#list(workspace_id: nil, cursor: nil, include_info: nil, labels: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, state: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSet>
Some parameter documentations has been truncated, see Models::ToolSetListParams for more details.
-
#list_events(tool_set_id, workspace_id: nil, cursor: nil, include_info: nil, labels: nil, limit: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSetEvent>
Some parameter documentations has been truncated, see Models::ToolSetListEventsParams for more details.
-
#list_usage(tool_set_id, workspace_id: nil, cursor: nil, limit: nil, sort_order: nil, tool_id: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSetUsage>
Some parameter documentations has been truncated, see Models::ToolSetListUsageParams for more details.
-
#retrieve(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetRetrieveParams for more details.
-
#unarchive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetUnarchiveParams for more details.
-
#update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ ToolSets
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 ToolSets.
391 392 393 394 395 |
# File 'lib/cadenya/resources/tool_sets.rb', line 391 def initialize(client:) @client = client @tools = Cadenya::Resources::ToolSets::Tools.new(client: client) @secrets = Cadenya::Resources::ToolSets::Secrets.new(client: client) end |
Instance Attribute Details
#secrets ⇒ Cadenya::Resources::ToolSets::Secrets (readonly)
Manage tool sets and the tools they contain. Tool sets group related tools, and tools define specific capabilities available to agents.
When a tool set is managed, only API key actors can modify its tools; human (profile) actors cannot.
25 26 27 |
# File 'lib/cadenya/resources/tool_sets.rb', line 25 def secrets @secrets end |
#tools ⇒ Cadenya::Resources::ToolSets::Tools (readonly)
Manage tool sets and the tools they contain. Tool sets group related tools, and tools define specific capabilities available to agents.
When a tool set is managed, only API key actors can modify its tools; human (profile) actors cannot.
17 18 19 |
# File 'lib/cadenya/resources/tool_sets.rb', line 17 def tools @tools end |
Instance Method Details
#archive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetArchiveParams for more details.
Transitions a tool set to STATE_ARCHIVED. Syncing stops, the tool set is hidden from list results, its tools are no longer offered to objectives, and new variation assignments are rejected. Existing assignments are retained, and history is preserved — unlike delete, archiving works while the tool set is still assigned to agent variations.
224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/cadenya/resources/tool_sets.rb', line 224 def archive(id, params = {}) parsed, = Cadenya::ToolSetArchiveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/tool_sets/%2$s:archive", workspace_id, id], model: Cadenya::ToolSet, options: ) end |
#create(metadata:, spec:, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetCreateParams for more details.
Creates a new tool set in the workspace
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cadenya/resources/tool_sets.rb', line 45 def create(params) parsed, = Cadenya::ToolSetCreateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/tool_sets", workspace_id], body: parsed, model: Cadenya::ToolSet, options: ) end |
#delete(id, workspace_id: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ToolSetDeleteParams for more details.
Deletes a tool set in the workspace
190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/cadenya/resources/tool_sets.rb', line 190 def delete(id, params = {}) parsed, = Cadenya::ToolSetDeleteParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :delete, path: ["v1/workspaces/%1$s/tool_sets/%2$s", workspace_id, id], model: NilClass, options: ) end |
#get_openapi_spec(tool_set_id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSetGetOpenAPISpecResponse
Some parameter documentations has been truncated, see Models::ToolSetGetOpenAPISpecParams for more details.
Retrieves the current OpenAPI specification JSON that has been consumed by the tool set. Only applicable to tool sets using the OpenAPI adapter.
255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/cadenya/resources/tool_sets.rb', line 255 def get_openapi_spec(tool_set_id, params = {}) parsed, = Cadenya::ToolSetGetOpenAPISpecParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :get, path: ["v1/workspaces/%1$s/tool_sets/%2$s/openapi_spec", workspace_id, tool_set_id], model: Cadenya::Models::ToolSetGetOpenAPISpecResponse, options: ) end |
#list(workspace_id: nil, cursor: nil, include_info: nil, labels: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, state: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSet>
Some parameter documentations has been truncated, see Models::ToolSetListParams for more details.
Lists all tool sets in the workspace
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/cadenya/resources/tool_sets.rb', line 157 def list(params = {}) parsed, = Cadenya::ToolSetListParams.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/tool_sets", workspace_id], query: query.transform_keys(include_info: "includeInfo", sort_order: "sortOrder"), page: Cadenya::Internal::CursorPagination, model: Cadenya::ToolSet, options: ) end |
#list_events(tool_set_id, workspace_id: nil, cursor: nil, include_info: nil, labels: nil, limit: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSetEvent>
Some parameter documentations has been truncated, see Models::ToolSetListEventsParams for more details.
Lists all events (including sync status) for a tool set
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/cadenya/resources/tool_sets.rb', line 295 def list_events(tool_set_id, params = {}) parsed, = Cadenya::ToolSetListEventsParams.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/tool_sets/%2$s/events", workspace_id, tool_set_id], query: query.transform_keys(include_info: "includeInfo", sort_order: "sortOrder"), page: Cadenya::Internal::CursorPagination, model: Cadenya::ToolSetEvent, options: ) end |
#list_usage(tool_set_id, workspace_id: nil, cursor: nil, limit: nil, sort_order: nil, tool_id: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSetUsage>
Some parameter documentations has been truncated, see Models::ToolSetListUsageParams for more details.
Lists the agent variations (with their parent agent) that have the tool set assigned. Pass tool_id to instead list variations with a direct assignment of that individual tool; variations that receive the tool implicitly through a whole-set assignment are not included in that filtered view.
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/cadenya/resources/tool_sets.rb', line 339 def list_usage(tool_set_id, params = {}) parsed, = Cadenya::ToolSetListUsageParams.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/tool_sets/%2$s/usage", workspace_id, tool_set_id], query: query.transform_keys(sort_order: "sortOrder", tool_id: "toolId"), page: Cadenya::Internal::CursorPagination, model: Cadenya::ToolSetUsage, options: ) end |
#retrieve(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetRetrieveParams for more details.
Retrieves a tool set by ID from the workspace
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cadenya/resources/tool_sets.rb', line 76 def retrieve(id, params = {}) parsed, = Cadenya::ToolSetRetrieveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :get, path: ["v1/workspaces/%1$s/tool_sets/%2$s", workspace_id, id], model: Cadenya::ToolSet, options: ) end |
#unarchive(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetUnarchiveParams for more details.
Transitions an archived tool set back to STATE_ACTIVE. Managed tool sets resume syncing on their next cycle and their tools become available to objectives again.
374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/cadenya/resources/tool_sets.rb', line 374 def unarchive(id, params = {}) parsed, = Cadenya::ToolSetUnarchiveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/tool_sets/%2$s:unarchive", workspace_id, id], model: Cadenya::ToolSet, options: ) end |
#update(id, workspace_id: nil, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetUpdateParams for more details.
Updates a tool set in the workspace
112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/cadenya/resources/tool_sets.rb', line 112 def update(id, params = {}) parsed, = Cadenya::ToolSetUpdateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :patch, path: ["v1/workspaces/%1$s/tool_sets/%2$s", workspace_id, id], body: parsed, model: Cadenya::ToolSet, options: ) end |