Class: Anthropic::Models::Beta::MemoryStores::BetaManagedAgentsMemoryVersion

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

Overview

See Also:

  • Anthropic::Resources::Beta::MemoryStores::MemoryVersions#retrieve

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:, created_at:, memory_id:, memory_store_id:, operation:, content: nil, content_sha256: nil, content_size_bytes: nil, created_by: nil, path: nil, redacted_at: nil, redacted_by: nil, type: :memory_version) ⇒ BetaManagedAgentsMemoryVersion

One entry in a memory's history, recording a single change and who made it.

Every change to a memory adds one version. Only redaction can change a version after that. Versions belong to the memory store and stay after the memory is deleted. Each version is retained for at least the version retention period after it was written, unless the store itself is deleted.

Retrieving a redacted version succeeds, with content, path, content_size_bytes, and content_sha256 set to null. Check redacted_at to find out whether a version was redacted.

See the memory guide to learn more about memory versions.

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

Parameters:



# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 114


Instance Attribute Details

#content ⇒ String?

The memory's UTF-8 text content as of this version. null when view=basic, when operation is deleted, or when redacted_at is set.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


54
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 54

optional :content, String, nil?: true

#content_sha256 ⇒ String?

Lowercase hex SHA-256 digest of content as of this version (64 characters). null when redacted_at is set or operation is deleted. Populated regardless of view otherwise.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


62
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 62

optional :content_sha256, String, nil?: true

#content_size_bytes ⇒ Integer?

Size of content in bytes as of this version. null when redacted_at is set or operation is deleted. Populated regardless of view otherwise.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


69
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 69

optional :content_size_bytes, Integer, nil?: true

#created_at ⇒ Time

When this version was written, in RFC 3339 format.

Parameters:

  • value (Time)

Returns:

  • (Time)


19
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 19

required :created_at, Time

#created_by ⇒ Anthropic::Models::Beta::MemoryStores::BetaManagedAgentsSessionActor, ...

Who made this change to the memory, or null if the author wasn't recorded.

Redacting the version doesn't change this field. A session_actor here is an agent that wrote through the store's mounted filesystem at /mnt/memory/. The version doesn't record the API key that created that session. So the author in created_by is who made the change, not who is ultimately responsible for it.

You can retrieve the session to learn more about where the change came from.



84
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 84

optional :created_by, union: -> { Anthropic::Beta::MemoryStores::BetaManagedAgentsActor }

#id ⇒ String

Unique identifier for this version (a memver_... value).

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 13

required :id, String

#memory_id ⇒ String

The ID of the memory that this version belongs to (mem_...).

The ID stays valid after the memory is deleted. Pass it as memory_id to List Memory Versions to get the memory's retained versions, including its deleted version while the lineage is retained.

Parameters:

  • value (String)

Returns:

  • (String)


30
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 30

required :memory_id, String

#memory_store_id ⇒ String

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

Parameters:

  • value (String)

Returns:

  • (String)


36
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 36

required :memory_store_id, String

#operation ⇒ Symbol, Anthropic::Models::Beta::MemoryStores::BetaManagedAgentsMemoryVersionOperation

The kind of mutation this version records: created, modified, or deleted.

Parameters:

  • value (Anthropic::Models::Beta::MemoryStores::beta_managed_agents_memory_version_operation)

Returns:



42
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 42

required :operation, enum: -> { Anthropic::Beta::MemoryStores::BetaManagedAgentsMemoryVersionOperation }

#path ⇒ String?

The memory's path at the time of this write. null if and only if redacted_at is set.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


91
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 91

optional :path, String, nil?: true

#redacted_at ⇒ Time?

When the version was redacted, in RFC 3339, or null if it hasn't been.

When set, content, path, content_size_bytes, and content_sha256 are null.

See the memory guide to learn more about redaction.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


104
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 104

optional :redacted_at, Time, nil?: true

#redacted_by ⇒ Anthropic::Models::Beta::MemoryStores::BetaManagedAgentsSessionActor, ...

Who redacted this version, or null if it has not been redacted. In practice always an api_actor, user_actor, or service_account_actor (agents do not have a redact capability).



112
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 112

optional :redacted_by, union: -> { Anthropic::Beta::MemoryStores::BetaManagedAgentsActor }

#type ⇒ Symbol, :memory_version

Parameters:

  • value (:memory_version)

Returns:

  • (Symbol, :memory_version)


47
# File 'lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb', line 47

required :type, const: :memory_version

Instance Method Details

#to_hash ⇒ { id: String, created_at: Time, memory_id: String, memory_store_id: String, operation: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_memory_version_operation, type: :memory_version, content: String?, :content_sha256 => String?, content_size_bytes: Integer?, created_by: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_actor, path: String?, redacted_at: Time?, redacted_by: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_actor }

Returns:

  • ({ id: String, created_at: Time, memory_id: String, memory_store_id: String, operation: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_memory_version_operation, type: :memory_version, content: String?, :content_sha256 => String?, content_size_bytes: Integer?, created_by: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_actor, path: String?, redacted_at: Time?, redacted_by: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_actor })


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rbs', line 73

def to_hash: -> {
  id: String,
  created_at: Time,
  memory_id: String,
  memory_store_id: String,
  operation: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_memory_version_operation,
  type: :memory_version,
  content: String?,
  :content_sha256 => String?,
  content_size_bytes: Integer?,
  created_by: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_actor,
  path: String?,
  redacted_at: Time?,
  redacted_by: Anthropic::Models::Beta::MemoryStores::beta_managed_agents_actor
}