ChatMasterMind Application Refactor and Enhancement #8
@ -3,7 +3,7 @@ from pathlib import Path
|
||||
from itertools import zip_longest
|
||||
from ..configuration import Config
|
||||
from ..chat import ChatDB
|
||||
from ..message import Message, Question, source_code
|
||||
from ..message import Message, MessageFilter, Question, source_code
|
||||
from ..ai_factory import create_ai
|
||||
from ..ai import AI, AIResponse
|
||||
|
||||
@ -52,8 +52,12 @@ def question_cmd(args: argparse.Namespace, config: Config) -> None:
|
||||
"""
|
||||
Handler for the 'question' command.
|
||||
"""
|
||||
mfilter = MessageFilter(tags_or=args.or_tags,
|
||||
tags_and=args.and_tags,
|
||||
tags_not=args.exclude_tags)
|
||||
chat = ChatDB.from_dir(cache_path=Path('.'),
|
||||
db_path=Path(config.db))
|
||||
db_path=Path(config.db),
|
||||
mfilter=mfilter)
|
||||
# if it's a new question, create and store it immediately
|
||||
if args.ask or args.create:
|
||||
message = create_message(chat, args)
|
||||
@ -77,14 +81,14 @@ def question_cmd(args: argparse.Namespace, config: Config) -> None:
|
||||
if response.tokens:
|
||||
print("===============")
|
||||
print(response.tokens)
|
||||
elif args.repeat:
|
||||
elif args.repeat is not None:
|
||||
lmessage = chat.latest_message()
|
||||
assert lmessage
|
||||
# TODO: repeat either the last question or the
|
||||
# one(s) given in 'args.repeat' (overwrite
|
||||
# existing ones if 'args.overwrite' is True)
|
||||
pass
|
||||
elif args.process:
|
||||
elif args.process is not None:
|
||||
# TODO: process either all questions without an
|
||||
# answer or the one(s) given in 'args.process'
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user