Class MemoryEntry.Builder

java.lang.Object
com.google.adk.memory.MemoryEntry.Builder
Enclosing class:
MemoryEntry

public abstract static class MemoryEntry.Builder extends Object
Builder for MemoryEntry.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setContent

      public abstract MemoryEntry.Builder setContent(com.google.genai.types.Content content)
      Sets the main content of the memory.

      This is a required field.

    • setAuthor

      public abstract MemoryEntry.Builder setAuthor(@Nullable String author)
      Sets the author of the memory.
    • setTimestamp

      public abstract MemoryEntry.Builder setTimestamp(@Nullable String timestamp)
      Sets the timestamp when the original content of this memory happened.
    • setTimestamp

      public MemoryEntry.Builder setTimestamp(Instant instant)
      A convenience method to set the timestamp from an Instant object, formatted as an ISO 8601 string.
      Parameters:
      instant - The timestamp as an Instant object.
    • build

      public abstract MemoryEntry build()
      Builds the immutable MemoryEntry object.