Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

refactor: move prompt string generation out of overloaded __str__ into a separate method (using 'string' atm, can change to something more explicitly named)

cpacker78fc7316b0c8
diff --git a/memgpt/schemas/memory.py b/memgpt/schemas/memory.py
index 7e8d408e3..4709f436a 100644
--- a/memgpt/schemas/memory.py
+++ b/memgpt/schemas/memory.py
@@ -20,6 +20,9 @@ class Memory(BaseModel, validate_assignment=True):
return obj
def __str__(self) -> str:
+ raise NotImplementedError("Use the .string() method instead")
+
+ def string(self) -> str:
"""Representation of the memory in-context"""
section_strs = []
for section, module in self.memory.items():