Make cmm q -a "test" completely work, similar as before, tests are not fixed yet.

This commit is contained in:
Oleksandr Kozachuk
2023-09-09 19:24:45 +02:00
parent 6395941516
commit 458ec20cbd
4 changed files with 30 additions and 13 deletions
+9 -5
View File
@@ -63,15 +63,19 @@ def question_cmd(args: argparse.Namespace, config: Config) -> None:
# create the correct AI instance
ai: AI = create_ai(args, config)
if args.ask:
ai.print()
chat.print(paged=False)
response: AIResponse = ai.request(message,
chat,
args.num_answers, # FIXME
args.output_tags) # FIXME
assert response
# TODO:
# * add answer to the message above (and create
# more messages for any additional answers)
pass
chat.add_to_cache(response.messages)
for idx, msg in enumerate(response.messages):
print(f"=== ANSWER {idx+1} ===")
print(msg.answer)
if response.tokens:
print("===============")
print(response.tokens)
elif args.repeat:
lmessage = chat.latest_message()
assert lmessage