diff --git a/chatmastermind/main.py b/chatmastermind/main.py index f80c26c..9c8c3c5 100755 --- a/chatmastermind/main.py +++ b/chatmastermind/main.py @@ -57,8 +57,7 @@ def create_question_with_hist(args: argparse.Namespace, full_question = '\n\n'.join(question_parts) chat = create_chat_hist(full_question, tags, extags, config, - args.match_all_tags, args.with_tags, - args.with_file) + args.match_all_tags, False, False) return chat, full_question, tags @@ -89,7 +88,7 @@ def ask_cmd(args: argparse.Namespace, config: dict) -> None: if args.model: config['openai']['model'] = args.model chat, question, tags = create_question_with_hist(args, config) - print_chat_hist(chat, args.dump, args.only_source_code) + print_chat_hist(chat, False, args.only_source_code) otags = args.output_tags or [] answers, usage = ai(chat, config, args.number) save_answers(question, answers, tags, otags, config) @@ -162,12 +161,16 @@ def create_parser() -> argparse.ArgumentParser: ask_cmd_parser = cmdparser.add_parser('ask', parents=[tag_parser], help="Ask a question.") ask_cmd_parser.set_defaults(func=ask_cmd) - ask_cmd_parser.add_argument('-q', '--question', nargs='+', help='Question to ask', required=True) + ask_cmd_parser.add_argument('-q', '--question', nargs='+', help='Question to ask', + required=True) ask_cmd_parser.add_argument('-m', '--max-tokens', help='Max tokens to use', type=int) ask_cmd_parser.add_argument('-T', '--temperature', help='Temperature to use', type=float) ask_cmd_parser.add_argument('-M', '--model', help='Model to use') - ask_cmd_parser.add_argument('-n', '--number', help='Number of answers to produce', type=int, default=1) + ask_cmd_parser.add_argument('-n', '--number', help='Number of answers to produce', type=int, + default=1) ask_cmd_parser.add_argument('-s', '--source', nargs='*', help='Source add content of a file to the query') + ask_cmd_parser.add_argument('-S', '--only-source-code', help='Add pure source code to the chat history', + action='store_true') # 'hist' command parser hist_cmd_parser = cmdparser.add_parser('hist', parents=[tag_parser],