added option '-w' to print chat history with tags
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user