Class: Anthropic::Models::Beta::MemoryStores::BetaManagedAgentsMemory

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb,
sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::MemoryStores::Memories#create

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, content_sha256:, content_size_bytes:, created_at:, memory_store_id:, memory_version_id:, path:, updated_at:, content: nil, type: :memory) ⇒ BetaManagedAgentsMemory

A text document at a path inside a memory store.

content is null when the response uses view=basic. content_size_bytes and content_sha256 are always set, so you can detect changes without fetching the content. To retrieve, update, or delete a memory, pass its ID, which stays the same when its path changes.

See the memory guide to learn more about working with memories.

Some parameter documentations has been truncated, see Anthropic::Models::Beta::MemoryStores::BetaManagedAgentsMemory for more details.

Parameters:

  • id (String) —

    The unique ID of the memory (mem_...). It stays the same when the memory's pat

  • content_sha256 (String) —

    Lowercase hex SHA-256 digest of the UTF-8 content bytes (64 characters). The s

  • content_size_bytes (Integer) —

    The size of the memory's content in UTF-8 bytes. It is set regardless of

  • created_at (Time) —

    When this memory was created, in RFC 3339 format.

  • memory_store_id (String) —

    ID of the memory store this memory belongs to (a memstore_... value).

  • memory_version_id (String) —

    The ID of the memory version that holds the memory's current content (

  • path (String) —

    Hierarchical path of the memory within the store, e.g. /projects/foo/notes.md.

  • updated_at (Time) —

    When the memory was last changed, in RFC 3339.

  • content (String, nil) (defaults to: nil) —

    The memory's UTF-8 text content, or null when the response uses view=basic.

  • type (Symbol, :memory) (defaults to: :memory)
  • id: (String)
  • content_sha256: (String)
  • content_size_bytes: (Integer)
  • created_at: (Time)
  • memory_store_id: (String)
  • memory_version_id: (String)
  • path: (String)
  • updated_at: (Time)
  • content: (String, nil) (defaults to: nil)
  • type: (:memory) (defaults to: :memory)


# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 90

Instance Attribute Details

#content ⇒ String?

The memory's UTF-8 text content, or null when the response uses view=basic.

The maximum size is 100 kB (102,400 bytes).

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


88
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 88

optional :content, String, nil?: true

#content_sha256 ⇒ String

Lowercase hex SHA-256 digest of the UTF-8 content bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a content_sha256 precondition on update. Always populated, regardless of view.

Parameters:

  • value (String)

Returns:

  • (String)


25
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 25

required :content_sha256, String

#content_size_bytes ⇒ Integer

The size of the memory's content in UTF-8 bytes. It is set regardless of view.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


32
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 32

required :content_size_bytes, Integer

#created_at ⇒ Time

When this memory was created, in RFC 3339 format.

Parameters:

  • value (Time)

Returns:

  • (Time)


38
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 38

required :created_at, Time

#id ⇒ String

The unique ID of the memory (mem_...). It stays the same when the memory's path changes.

To retrieve, update, or delete the memory, pass this ID.

Parameters:

  • value (String)

Returns:

  • (String)


16
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 16

required :id, String

#memory_store_id ⇒ String

ID of the memory store this memory belongs to (a memstore_... value).

Parameters:

  • value (String)

Returns:

  • (String)


44
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 44

required :memory_store_id, String

#memory_version_id ⇒ String

The ID of the memory version that holds the memory's current content (memver_...).

Memory versions don't have a flag that marks the latest one. Compare their IDs with this field instead.

See the memory guide to learn more about memory versions.

Parameters:

  • value (String)

Returns:

  • (String)


58
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 58

required :memory_version_id, String

#path ⇒ String

Hierarchical path of the memory within the store, e.g. /projects/foo/notes.md. Always starts with /. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.

Parameters:

  • value (String)

Returns:

  • (String)


66
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 66

required :path, String

#type ⇒ Symbol, :memory

Parameters:

  • value (:memory)

Returns:

  • (Symbol, :memory)


71
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 71

required :type, const: :memory

#updated_at ⇒ Time

When the memory was last changed, in RFC 3339.

To find out who made the change, look at created_by on the memory version that memory_version_id references.

Parameters:

  • value (Time)

Returns:

  • (Time)


80
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb', line 80

required :updated_at, Time

Instance Method Details

#to_hash ⇒ { id: String, :content_sha256 => String, content_size_bytes: Integer, created_at: Time, memory_store_id: String, memory_version_id: String, path: String, type: :memory, updated_at: Time, content: String? }

Returns:

  • ({ id: String, :content_sha256 => String, content_size_bytes: Integer, created_at: Time, memory_store_id: String, memory_version_id: String, path: String, type: :memory, updated_at: Time, content: String? })


53
54
55
56
57
58
59
60
61
62
63
64
# File 'sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rbs', line 53

def to_hash: -> {
  id: String,
  :content_sha256 => String,
  content_size_bytes: Integer,
  created_at: Time,
  memory_store_id: String,
  memory_version_id: String,
  path: String,
  type: :memory,
  updated_at: Time,
  content: String?
}