fix: fix test actually running (#587)

* fix: fix test actually running

* fix: fix test to not send request to openai

* fix: fix linting to remove cli files

* fix: exclude only files that breaks black
This commit is contained in:
Eduardo Chiarotti
2024-05-09 21:33:48 -03:00
committed by GitHub
parent 95d13bd033
commit 1da7473f26
4 changed files with 422 additions and 5 deletions

View File

@@ -10,6 +10,7 @@ def short_term_memory():
return ShortTermMemory()
@pytest.mark.vcr(filter_headers=["authorization"])
def test_save_and_search(short_term_memory):
memory = ShortTermMemoryItem(
data="""test value test value test value test value test value test value
@@ -19,6 +20,7 @@ def test_save_and_search(short_term_memory):
metadata={"task": "test_task"},
)
short_term_memory.save(memory)
find = short_term_memory.search("test value", score_threshold=0.01)[0]
assert find["context"] == memory.data, "Data value mismatch."
assert find["metadata"]["agent"] == "test_agent", "Agent value mismatch."