Skip to content

Commit

Permalink
Test building user memory tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
preritdas committed May 6, 2023
1 parent d63c986 commit 7cd9df9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_user_memory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Test user memory."""
from langchain.tools import BaseTool

from apps.gpt.user_memory import UserMemory, create_user_memory_tools


Expand All @@ -16,3 +18,14 @@ def test_retrieving_from_memory(temporary_user_memory):
"""
user_memory = UserMemory.from_user_phone(temporary_user_memory)
assert "2" in user_memory.answer_question("Where did I park?")


def test_building_user_memory_tools(temporary_user_memory):
"""
Test building user memory tools.
This tests prompts and prompt reading and building the tools.
"""
user_memory_tools = create_user_memory_tools(temporary_user_memory)

assert isinstance(user_memory_tools, list)
assert all(isinstance(tool, BaseTool) for tool in user_memory_tools)

0 comments on commit 7cd9df9

Please sign in to comment.