feat: add route for editing a memory blocks limit (via Memory, instead of via Blocks) (#2084)

This commit is contained in:
Charles Packer
2024-11-21 19:52:08 -08:00
committed by GitHub
parent cb85ccebc1
commit 17e39a57fe
7 changed files with 134 additions and 3 deletions

View File

@@ -105,3 +105,16 @@ def test_memory_jinja2_set_template(sample_memory: Memory):
)
with pytest.raises(ValueError):
sample_memory.set_prompt_template(prompt_template=template_bad_memory_structure)
def test_update_block_limit(sample_memory: Memory):
"""Test updating the limit of a block"""
test_new_limit = 1000
current_labels = sample_memory.list_block_labels()
test_old_label = current_labels[0]
assert sample_memory.get_block(label=test_old_label).limit != test_new_limit
sample_memory.update_block_limit(label=test_old_label, limit=test_new_limit)
assert sample_memory.get_block(label=test_old_label).limit == test_new_limit