From 92317e16c967fcdc635753340aebfa4c59dfef62 Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Thu, 24 Sep 2026 10:34:37 -0700 Subject: [PATCH] feat: add context field to MemoryConfig PiperOrigin-RevId: 987602465 --- agentplatform/_genai/memories.py | 6 ++++++ agentplatform/_genai/types/common.py | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/agentplatform/_genai/memories.py b/agentplatform/_genai/memories.py index 6c660c14d2..329a5c7af4 100644 --- a/agentplatform/_genai/memories.py +++ b/agentplatform/_genai/memories.py @@ -290,6 +290,9 @@ def _MemoryConfig_to_vertex( if getv(from_object, ["memory_id"]) is not None: setv(parent_object, ["_query", "memoryId"], getv(from_object, ["memory_id"])) + if getv(from_object, ["context"]) is not None: + setv(parent_object, ["context"], getv(from_object, ["context"])) + return to_object @@ -448,6 +451,9 @@ def _UpdateMemoryConfig_to_vertex( if getv(from_object, ["memory_id"]) is not None: setv(parent_object, ["_query", "memoryId"], getv(from_object, ["memory_id"])) + if getv(from_object, ["context"]) is not None: + setv(parent_object, ["context"], getv(from_object, ["context"])) + if getv(from_object, ["update_mask"]) is not None: setv( parent_object, ["_query", "updateMask"], getv(from_object, ["update_mask"]) diff --git a/agentplatform/_genai/types/common.py b/agentplatform/_genai/types/common.py index 7c83714a17..bf0e7b8329 100644 --- a/agentplatform/_genai/types/common.py +++ b/agentplatform/_genai/types/common.py @@ -11412,6 +11412,9 @@ class MemoryConfig(_common.BaseModel): default=None, description="""Optional. The user defined ID to use for memory, which will become the final component of the memory resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""", ) + context: Optional[str] = Field( + default=None, description="""Optional. Represents the context of the memory.""" + ) class MemoryConfigDict(TypedDict, total=False): @@ -11455,6 +11458,9 @@ class MemoryConfigDict(TypedDict, total=False): memory_id: Optional[str] """Optional. The user defined ID to use for memory, which will become the final component of the memory resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""" + context: Optional[str] + """Optional. Represents the context of the memory.""" + MemoryConfigOrDict = Union[MemoryConfig, MemoryConfigDict] @@ -12979,6 +12985,9 @@ class UpdateMemoryConfig(_common.BaseModel): default=None, description="""Optional. The user defined ID to use for memory, which will become the final component of the memory resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""", ) + context: Optional[str] = Field( + default=None, description="""Optional. Represents the context of the memory.""" + ) update_mask: Optional[str] = Field( default=None, description="""The update mask to apply. For the `FieldMask` definition, see @@ -13027,6 +13036,9 @@ class UpdateMemoryConfigDict(TypedDict, total=False): memory_id: Optional[str] """Optional. The user defined ID to use for memory, which will become the final component of the memory resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number.""" + context: Optional[str] + """Optional. Represents the context of the memory.""" + update_mask: Optional[str] """The update mask to apply. For the `FieldMask` definition, see https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask."""