Wire up GPT understand method to /chat API. Log conversation metadata too

This commit is contained in:
Debanjum Singh Solanky
2021-11-28 00:04:39 +05:30
parent 882e0f81b4
commit 67c3cd7372
3 changed files with 59 additions and 26 deletions

View File

@@ -96,10 +96,11 @@ class SearchConfig():
class ConversationProcessorConfig():
def __init__(self, conversation_logfile, conversation_history, openai_api_key, verbose):
def __init__(self, conversation_logfile, chat_log, meta_log, openai_api_key, verbose):
self.openai_api_key = openai_api_key
self.conversation_logfile = conversation_logfile
self.conversation_history = conversation_history
self.chat_log = chat_log
self.meta_log = meta_log
self.verbose = verbose
def create_from_dictionary(config, key_tree, verbose):
@@ -109,7 +110,8 @@ class ConversationProcessorConfig():
return ConversationProcessorConfig(
openai_api_key = conversation_config['openai-api-key'],
conversation_history = '',
chat_log = '',
meta_log = [],
conversation_logfile = Path(conversation_config['conversation-logfile']),
verbose = verbose)