cmm: added 'question' command
This commit is contained in:
+9
-9
@@ -114,14 +114,14 @@ class TestHandleQuestion(CmmTestCase):
|
||||
def setUp(self) -> None:
|
||||
self.question = "test question"
|
||||
self.args = argparse.Namespace(
|
||||
tags=['tag1'],
|
||||
atags=None,
|
||||
etags=['etag1'],
|
||||
or_tags=['tag1'],
|
||||
and_tags=None,
|
||||
exclude_tags=['xtag1'],
|
||||
output_tags=None,
|
||||
question=[self.question],
|
||||
source=None,
|
||||
source_code_only=False,
|
||||
number=3,
|
||||
num_answers=3,
|
||||
max_tokens=None,
|
||||
temperature=None,
|
||||
model=None,
|
||||
@@ -143,12 +143,12 @@ class TestHandleQuestion(CmmTestCase):
|
||||
open_mock = MagicMock()
|
||||
with patch("chatmastermind.storage.open", open_mock):
|
||||
ask_cmd(self.args, self.config)
|
||||
mock_print_tag_args.assert_called_once_with(self.args.tags,
|
||||
self.args.etags,
|
||||
mock_print_tag_args.assert_called_once_with(self.args.or_tags,
|
||||
self.args.exclude_tags,
|
||||
[])
|
||||
mock_create_chat_hist.assert_called_once_with(self.question,
|
||||
self.args.tags,
|
||||
self.args.etags,
|
||||
self.args.or_tags,
|
||||
self.args.exclude_tags,
|
||||
self.config,
|
||||
match_all_tags=False,
|
||||
with_tags=False,
|
||||
@@ -158,7 +158,7 @@ class TestHandleQuestion(CmmTestCase):
|
||||
self.args.source_code_only)
|
||||
mock_ai.assert_called_with("test_chat",
|
||||
self.config,
|
||||
self.args.number)
|
||||
self.args.num_answers)
|
||||
expected_calls = []
|
||||
for num, answer in enumerate(mock_ai.return_value[0], start=1):
|
||||
title = f'-- ANSWER {num} '
|
||||
|
||||
Reference in New Issue
Block a user