Skip to content

Commit 4dd28a3

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: Add id and custom_metadata fields to MemoryEntry
PiperOrigin-RevId: 833581243
1 parent b2c45f8 commit 4dd28a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/google/adk/memory/memory_entry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515

1616
from __future__ import annotations
1717

18+
from typing import Any
1819
from typing import Optional
1920

2021
from google.genai import types
2122
from pydantic import BaseModel
23+
from pydantic import Field
2224

2325

2426
class MemoryEntry(BaseModel):
@@ -27,6 +29,12 @@ class MemoryEntry(BaseModel):
2729
content: types.Content
2830
"""The main content of the memory."""
2931

32+
custom_metadata: dict[str, Any] = Field(default_factory=dict)
33+
"""Optional custom metadata associated with the memory."""
34+
35+
id: Optional[str] = None
36+
"""The unique identifier of the memory."""
37+
3038
author: Optional[str] = None
3139
"""The author of the memory."""
3240

0 commit comments

Comments
 (0)