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
+3 -2
View File
@@ -62,7 +62,8 @@ def save_answers(question: str,
def create_chat(question: Optional[str],
tags: Optional[List[str]],
extags: Optional[List[str]],
config: Dict[str, Any]
config: Dict[str, Any],
with_tags: bool = False
) -> List[Dict[str, str]]:
chat: List[Dict[str, str]] = []
append_message(chat, 'system', config['system'].strip())
@@ -80,7 +81,7 @@ def create_chat(question: Optional[str],
extags_do_not_match = \
not extags or not data_tags.intersection(extags)
if tags_match and extags_do_not_match:
message_to_chat(data, chat)
message_to_chat(data, chat, with_tags)
if question:
append_message(chat, 'user', question)
return chat