From e6247692e5f0879d270cfb30e4da83d01f6576f6 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Fri, 6 Sep 2024 13:18:54 -0700 Subject: [PATCH] refactor: remove the concept of 'section' from the jinja2 prompt formatter (#1726) --- memgpt/schemas/memory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memgpt/schemas/memory.py b/memgpt/schemas/memory.py index 35313733..ea15356a 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" - "" + "" "{% if not loop.last %}\n{% endif %}" "{% endfor %}", description="Jinja2 template for compiling memory blocks into a prompt string",