refactor: remove the concept of 'section' from the jinja2 prompt formatter (#1726)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user