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: remove the concept of 'section' from the jinja2 prompt formatter (#1726)

Charles Packere6247692e5f0
diff --git a/memgpt/schemas/memory.py b/memgpt/schemas/memory.py
index 35313733f..ea15356ab 100644
--- a/memgpt/schemas/memory.py
+++ b/memgpt/schemas/memory.py
@@ -25,10 +25,10 @@ class Memory(BaseModel, validate_assignment=True):
# Memory.template is a Jinja2 template for compiling memory module into a prompt string.
prompt_template: str = Field(
- default="{% for section, block in memory.items() %}"
- '<{{ section }} characters="{{ block.value|length }}/{{ block.limit }}">\n'
+ default="{% for block in memory.values() %}"
+ '<{{ block.name }} characters="{{ block.value|length }}/{{ block.limit }}">\n'
"{{ block.value }}\n"
- "</{{ section }}>"
+ "</{{ block.name }}>"
"{% if not loop.last %}\n{% endif %}"
"{% endfor %}",
description="Jinja2 template for compiling memory blocks into a prompt string",