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,
sig/cadenya/resources/memory_layers.rbs,
sig/cadenya/resources/memory_layers/entries.rbs
Overview
Manage memory layers and their entries. Layers are named containers that can be composed into an objective's memory cascade; 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(metadata:, spec:, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Some parameter documentations has been truncated, see Models::MemoryLayerCreateParams for more details.
-
#delete(id, workspace_id: nil, request_options: {}) ⇒ nil
Deletes a memory layer from the workspace.
-
#initialize(client:) ⇒ MemoryLayers
constructor
private
A new instance of MemoryLayers.
-
#list(workspace_id: nil, agent_id: nil, cursor: nil, episodic_key_prefix: nil, include_info: nil, labels: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, type: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::MemoryLayer>
Some parameter documentations has been truncated, see Models::MemoryLayerListParams for more details.
-
#retrieve(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Retrieves a memory layer by ID from the workspace.
-
#update(id, workspace_id: nil, 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.
201 202 203 204 |
# File 'lib/cadenya/resources/memory_layers.rb', line 201 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 cascade; 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(metadata:, spec:, workspace_id: nil, 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 45 46 47 48 |
# File 'lib/cadenya/resources/memory_layers.rb', line 35 def create(params) parsed, = Cadenya::MemoryLayerCreateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :post, path: ["v1/workspaces/%1$s/memory_layers", workspace_id], body: parsed, model: Cadenya::MemoryLayer, options: ) end |
#delete(id, workspace_id: nil, request_options: {}) ⇒ nil
Deletes a memory layer from the workspace
184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/cadenya/resources/memory_layers.rb', line 184 def delete(id, params = {}) parsed, = Cadenya::MemoryLayerDeleteParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :delete, path: ["v1/workspaces/%1$s/memory_layers/%2$s", workspace_id, id], model: NilClass, options: ) end |
#list(workspace_id: nil, agent_id: nil, cursor: nil, episodic_key_prefix: nil, include_info: nil, labels: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, type: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::MemoryLayer>
Some parameter documentations has been truncated, see Models::MemoryLayerListParams for more details.
Lists all memory layers in the workspace
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/cadenya/resources/memory_layers.rb', line 149 def list(params = {}) parsed, = Cadenya::MemoryLayerListParams.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/memory_layers", workspace_id], query: query.transform_keys( agent_id: "agentId", episodic_key_prefix: "episodicKeyPrefix", include_info: "includeInfo", sort_order: "sortOrder" ), page: Cadenya::Internal::CursorPagination, model: Cadenya::MemoryLayer, options: ) end |
#retrieve(id, workspace_id: nil, request_options: {}) ⇒ Cadenya::Models::MemoryLayer
Retrieves a memory layer by ID from the workspace
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cadenya/resources/memory_layers.rb', line 63 def retrieve(id, params = {}) parsed, = Cadenya::MemoryLayerRetrieveParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id 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: nil, 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
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/cadenya/resources/memory_layers.rb', line 100 def update(id, params = {}) parsed, = Cadenya::MemoryLayerUpdateParams.dump_request(params) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :patch, path: ["v1/workspaces/%1$s/memory_layers/%2$s", workspace_id, id], body: parsed, model: Cadenya::MemoryLayer, options: ) end |