chore: add deprecation notices to UserMemory (#3201)

- Mark UserMemory and UserMemoryItem for removal in v0.156.0 or 2025-08-04
- Update all references with deprecation warnings
- Users should migrate to ExternalMemory
This commit is contained in:
Greyson LaLonde
2025-07-21 15:26:34 -04:00
committed by GitHub
parent 3c55c8a22a
commit 2ab6c31544
5 changed files with 15 additions and 4 deletions

View File

@@ -1,8 +1,16 @@
import warnings
from typing import Any, Dict, Optional
class UserMemoryItem:
def __init__(self, data: Any, user: str, metadata: Optional[Dict[str, Any]] = None):
warnings.warn(
"UserMemoryItem is deprecated and will be removed in version 0.156.0 "
"or on 2025-08-04, whichever comes first. "
"Please use ExternalMemory instead.",
DeprecationWarning,
stacklevel=2,
)
self.data = data
self.user = user
self.metadata = metadata if metadata is not None else {}