Class: Cadenya::Resources::MemoryLayers
- Inherits:
-
Object
- Object
- Cadenya::Resources::MemoryLayers
- Defined in:
- lib/cadenya/resources/memory_layers.rb,
lib/cadenya/resources/memory_layers/entries.rb
Overview
Manage memory layers and their entries. Layers are named containers that can be composed into an objective’s memory stack; entries are the keyed values within a layer. System-managed layers (e.g., episodic layers created by the runtime) cannot be mutated through this API.
Defined Under Namespace
Classes: Entries
Instance Attribute Summary collapse
-
#entries ⇒ Cadenya::Resources::MemoryLayers::Entries
readonly
Manage memory layers and their entries.
Instance Method Summary collapse
-
#create(workspace_id, metadata:, spec:, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Some parameter documentations has been truncated, see Models::MemoryLayerCreateParams for more details.
-
#delete(id, workspace_id:, request_options: {}) ⇒ nil
Deletes a memory layer from the workspace.
-
#initialize(client:) ⇒ MemoryLayers
constructor
private
A new instance of MemoryLayers.
-
#list(workspace_id, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, type: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::MemoryLayer>
Lists all memory layers in the workspace.
-
#retrieve(id, workspace_id:, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Retrieves a memory layer by ID from the workspace.
-
#update(id, workspace_id:, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Some parameter documentations has been truncated, see Models::MemoryLayerUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ MemoryLayers
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 MemoryLayers.
185 186 187 188 |
# File 'lib/cadenya/resources/memory_layers.rb', line 185 def initialize(client:) @client = client @entries = Cadenya::Resources::MemoryLayers::Entries.new(client: client) end |
Instance Attribute Details
#entries ⇒ Cadenya::Resources::MemoryLayers::Entries (readonly)
Manage memory layers and their entries. Layers are named containers that can be composed into an objective’s memory stack; entries are the keyed values within a layer. System-managed layers (e.g., episodic layers created by the runtime) cannot be mutated through this API.
15 16 17 |
# File 'lib/cadenya/resources/memory_layers.rb', line 15 def entries @entries end |
Instance Method Details
#create(workspace_id, metadata:, spec:, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Some parameter documentations has been truncated, see Models::MemoryLayerCreateParams for more details.
Creates a new memory layer in the workspace
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cadenya/resources/memory_layers.rb', line 35 def create(workspace_id, params) parsed, = Cadenya::MemoryLayerCreateParams.dump_request(params) @client.request( method: :post, path: ["v1/workspaces/%1$s/memory_layers", workspace_id], body: parsed, model: Cadenya::MemoryLayer, options: ) end |
#delete(id, workspace_id:, request_options: {}) ⇒ nil
Deletes a memory layer from the workspace
168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/cadenya/resources/memory_layers.rb', line 168 def delete(id, params) parsed, = Cadenya::MemoryLayerDeleteParams.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/memory_layers/%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, type: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::MemoryLayer>
Lists all memory layers in the workspace
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/cadenya/resources/memory_layers.rb', line 138 def list(workspace_id, params = {}) parsed, = Cadenya::MemoryLayerListParams.dump_request(params) query = Cadenya::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/workspaces/%1$s/memory_layers", workspace_id], query: query.transform_keys( bundle_key: "bundleKey", include_info: "includeInfo", sort_order: "sortOrder" ), page: Cadenya::Internal::CursorPagination, model: Cadenya::MemoryLayer, options: ) end |
#retrieve(id, workspace_id:, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Retrieves a memory layer by ID from the workspace
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cadenya/resources/memory_layers.rb', line 59 def retrieve(id, params) parsed, = Cadenya::MemoryLayerRetrieveParams.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/memory_layers/%2$s", workspace_id, id], model: Cadenya::MemoryLayer, options: ) end |
#update(id, workspace_id:, metadata: nil, spec: nil, update_mask: nil, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Some parameter documentations has been truncated, see Models::MemoryLayerUpdateParams for more details.
Updates a memory layer in the workspace
external_id:<val
96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/cadenya/resources/memory_layers.rb', line 96 def update(id, params) parsed, = Cadenya::MemoryLayerUpdateParams.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/memory_layers/%2$s", workspace_id, id], body: parsed, model: Cadenya::MemoryLayer, options: ) end |