Skip to content

Commit

Permalink
tests: added minimal tests for chats tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Sep 7, 2024
1 parent 5cb3936 commit d079af4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gptme/tools/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def _summarize_conversation(log_manager, include_summary: bool) -> list[str]:
return summary_lines


def list_chats(max_results: int = 5, include_summary: bool = True) -> None:
def list_chats(max_results: int = 5, include_summary: bool = False) -> None:
"""
List recent chat conversations and optionally summarize them.
List recent chat conversations and optionally summarize them using an LLM.
Args:
max_results (int): Maximum number of conversations to display.
Expand Down
13 changes: 13 additions & 0 deletions tests/test_tools_chats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from gptme.tools.chats import list_chats, search_chats


def test_list_chats(capsys):
list_chats()
captured = capsys.readouterr()
assert "1." in captured.out


def test_search_chats(capsys):
search_chats("python")
captured = capsys.readouterr()
assert "Found matches" in captured.out

0 comments on commit d079af4

Please sign in to comment.