added option '-w' to print chat history with tags

This commit is contained in:
2023-08-04 18:15:04 +02:00
parent bcfb41917a
commit b57d78a875
4 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -55,7 +55,7 @@ def process_and_display_chat(args: argparse.Namespace,
question_parts.append(f"```\n{r.read().strip()}\n```")
full_question = '\n\n'.join(question_parts)
chat = create_chat(full_question, tags, extags, config)
chat = create_chat(full_question, tags, extags, config, args.with_tags)
display_chat(chat, dump, args.only_source_code)
return chat, full_question, tags
@@ -94,6 +94,7 @@ def create_parser() -> argparse.ArgumentParser:
parser.add_argument('-n', '--number', help='Number of answers to produce', type=int, default=1)
parser.add_argument('-s', '--source', nargs='*', help='Source add content of a file to the query')
parser.add_argument('-S', '--only-source-code', help='Print only source code', action='store_true')
parser.add_argument('-w', '--with-tags', help="Print chat with tags.", action='store_true')
tags_arg = parser.add_argument('-t', '--tags', nargs='*', help='List of tag names', metavar='TAGS')
tags_arg.completer = tags_completer # type: ignore
extags_arg = parser.add_argument('-e', '--extags', nargs='*', help='List of tag names to exclude', metavar='EXTAGS')