Class BetaManagedAgentsMemoryListItem

  • All Implemented Interfaces:

    
    public final class BetaManagedAgentsMemoryListItem
    
                        

    One item in a /en/api/beta/memory_stores/memories/list response: either a memory object or, when depth is set, a memory_prefix rollup marker.

    • Constructor Detail

    • Method Detail

      • memory

         final Optional<BetaManagedAgentsMemory> memory()

        A memory object: a single text document at a hierarchical path inside a memory store. The content field is populated when view=full and null when view=basic; the content_size_bytes and content_sha256 fields are always populated so sync clients can diff without fetching content. Memories are addressed by their mem_... ID; the path is the create key and can be changed via update.

      • memoryPrefix

         final Optional<BetaManagedAgentsMemoryPrefix> memoryPrefix()

        A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when depth is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page limit and interleaves with memory items in path order.

      • asMemory

         final BetaManagedAgentsMemory asMemory()

        A memory object: a single text document at a hierarchical path inside a memory store. The content field is populated when view=full and null when view=basic; the content_size_bytes and content_sha256 fields are always populated so sync clients can diff without fetching content. Memories are addressed by their mem_... ID; the path is the create key and can be changed via update.

      • asMemoryPrefix

         final BetaManagedAgentsMemoryPrefix asMemoryPrefix()

        A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when depth is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page limit and interleaves with memory items in path order.

      • accept

         final <T extends Any> T accept(BetaManagedAgentsMemoryListItem.Visitor<T> visitor)

        Maps this instance's current variant to a value of type T using the given visitor.

        Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:

        import com.anthropic.core.JsonValue;
        import java.util.Optional;
        
        Optional<String> result = betaManagedAgentsMemoryListItem.accept(new BetaManagedAgentsMemoryListItem.Visitor<Optional<String>>() {
            @Override
            public Optional<String> visitMemory(BetaManagedAgentsMemory memory) {
                return Optional.of(memory.toString());
            }
        
            // ...
        
            @Override
            public Optional<String> unknown(JsonValue json) {
                // Or inspect the `json`.
                return Optional.empty();
            }
        });
      • validate

         final BetaManagedAgentsMemoryListItem validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.

      • ofMemory

         final static BetaManagedAgentsMemoryListItem ofMemory(BetaManagedAgentsMemory memory)

        A memory object: a single text document at a hierarchical path inside a memory store. The content field is populated when view=full and null when view=basic; the content_size_bytes and content_sha256 fields are always populated so sync clients can diff without fetching content. Memories are addressed by their mem_... ID; the path is the create key and can be changed via update.

      • ofMemoryPrefix

         final static BetaManagedAgentsMemoryListItem ofMemoryPrefix(BetaManagedAgentsMemoryPrefix memoryPrefix)

        A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when depth is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page limit and interleaves with memory items in path order.