Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/main/java/com/google/cloud/agentplatform/Memories.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ ObjectNode memoryConfigToVertex(JsonNode fromObject, ObjectNode parentObject) {
Common.getValueByPath(fromObject, new String[] {"memoryId"}));
}

if (Common.getValueByPath(fromObject, new String[] {"context"}) != null) {
Common.setValueByPath(
parentObject,
new String[] {"context"},
Common.getValueByPath(fromObject, new String[] {"context"}));
}

return toObject;
}

Expand Down Expand Up @@ -635,6 +642,13 @@ ObjectNode updateMemoryConfigToVertex(JsonNode fromObject, ObjectNode parentObje
Common.getValueByPath(fromObject, new String[] {"memoryId"}));
}

if (Common.getValueByPath(fromObject, new String[] {"context"}) != null) {
Common.setValueByPath(
parentObject,
new String[] {"context"},
Common.getValueByPath(fromObject, new String[] {"context"}));
}

if (Common.getValueByPath(fromObject, new String[] {"updateMask"}) != null) {
Common.setValueByPath(
parentObject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public abstract class MemoryConfig extends JsonSerializable {
@JsonProperty("memoryId")
public abstract Optional<String> memoryId();

/** Optional. Represents the context of the memory. */
@JsonProperty("context")
public abstract Optional<String> context();

/** Instantiates a builder for MemoryConfig. */
@ExcludeFromGeneratedCoverageReport
public static Builder builder() {
Expand Down Expand Up @@ -371,6 +375,24 @@ public Builder clearMemoryId() {
return memoryId(Optional.empty());
}

/**
* Setter for context.
*
* <p>context: Optional. Represents the context of the memory.
*/
@JsonProperty("context")
public abstract Builder context(String context);

@ExcludeFromGeneratedCoverageReport
abstract Builder context(Optional<String> context);

/** Clears the value of context field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearContext() {
return context(Optional.empty());
}

public abstract MemoryConfig build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public abstract class UpdateMemoryConfig extends JsonSerializable {
@JsonProperty("memoryId")
public abstract Optional<String> memoryId();

/** Optional. Represents the context of the memory. */
@JsonProperty("context")
public abstract Optional<String> context();

/**
* The update mask to apply. For the `FieldMask` definition, see
* https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.
Expand Down Expand Up @@ -378,6 +382,24 @@ public Builder clearMemoryId() {
return memoryId(Optional.empty());
}

/**
* Setter for context.
*
* <p>context: Optional. Represents the context of the memory.
*/
@JsonProperty("context")
public abstract Builder context(String context);

@ExcludeFromGeneratedCoverageReport
abstract Builder context(Optional<String> context);

/** Clears the value of context field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearContext() {
return context(Optional.empty());
}

/**
* Setter for updateMask.
*
Expand Down
Loading