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
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
Classes: Tools
Instance Attribute Summary collapse
-
#tools ⇒ Cadenya::Resources::ToolSets::Tools
readonly
Manage tool sets and the tools they contain.
Instance Method Summary collapse
-
#create(workspace_id, metadata:, spec:, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetCreateParams for more details.
-
#delete(id, workspace_id:, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ToolSetDeleteParams for more details.
-
#get_openapi_spec(tool_set_id, workspace_id:, 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, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSet>
Lists all tool sets in the workspace.
-
#list_events(tool_set_id, workspace_id:, cursor: nil, include_info: 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.
-
#retrieve(id, workspace_id:, request_options: {}) ⇒ Cadenya::Models::ToolSet
Some parameter documentations has been truncated, see Models::ToolSetRetrieveParams for more details.
-
#update(id, workspace_id:, 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.
262 263 264 265 |
# File 'lib/cadenya/resources/tool_sets.rb', line 262 def initialize(client:) @client = client @tools = Cadenya::Resources::ToolSets::Tools.new(client: client) end |
Instance Attribute Details
#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
#create(workspace_id, metadata:, spec:, 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
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cadenya/resources/tool_sets.rb', line 37 def create(workspace_id, params) parsed, = Cadenya::ToolSetCreateParams.dump_request(params) @client.request( method: :post, path: ["v1/workspaces/%1$s/tool_sets", workspace_id], body: parsed, model: Cadenya::ToolSet, options: ) end |
#delete(id, workspace_id:, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ToolSetDeleteParams for more details.
Deletes a tool set in the workspace
173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/cadenya/resources/tool_sets.rb', line 173 def delete(id, params) parsed, = Cadenya::ToolSetDeleteParams.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/tool_sets/%2$s", workspace_id, id], model: NilClass, options: ) end |
#get_openapi_spec(tool_set_id, workspace_id:, 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.
204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/cadenya/resources/tool_sets.rb', line 204 def get_openapi_spec(tool_set_id, params) parsed, = Cadenya::ToolSetGetOpenAPISpecParams.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/tool_sets/%2$s/openapi_spec", workspace_id, tool_set_id], model: Cadenya::Models::ToolSetGetOpenAPISpecResponse, options: ) end |
#list(workspace_id, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSet>
Lists all tool sets in the workspace
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/cadenya/resources/tool_sets.rb', line 140 def list(workspace_id, params = {}) parsed, = Cadenya::ToolSetListParams.dump_request(params) query = Cadenya::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/workspaces/%1$s/tool_sets", workspace_id], query: query.transform_keys( bundle_key: "bundleKey", include_info: "includeInfo", sort_order: "sortOrder" ), page: Cadenya::Internal::CursorPagination, model: Cadenya::ToolSet, options: ) end |
#list_events(tool_set_id, workspace_id:, cursor: nil, include_info: 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
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/cadenya/resources/tool_sets.rb', line 242 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 raise ArgumentError.new("missing required path argument #{_1}") 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 |
#retrieve(id, workspace_id:, 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
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/cadenya/resources/tool_sets.rb', line 64 def retrieve(id, params) parsed, = Cadenya::ToolSetRetrieveParams.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/tool_sets/%2$s", workspace_id, id], model: Cadenya::ToolSet, options: ) end |
#update(id, workspace_id:, 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
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/cadenya/resources/tool_sets.rb', line 100 def update(id, params) parsed, = Cadenya::ToolSetUpdateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: ["v1/workspaces/%1$s/tool_sets/%2$s", workspace_id, id], body: parsed, model: Cadenya::ToolSet, options: ) end |