Load, Save Conversation Session Summaries to Log. s/chat_log/chat_session

Conversation logs structure now has session info too instead of just chat info
Session info will allow loading past conversation summaries as context for AI in new conversations

{
    "session": [
    {
        "summary": <chat_session_summary>,
        "session-start": <session_start_index_in_chat_log>,
        "session-end": <session_end_index_in_chat_log>
    }],
    "chat": [
    {
        "intent": <intent-object>
        "trigger-emotion": <emotion-triggered-by-message>
        "by": <AI|Human>
        "message": <chat_message>
        "created": <message_created_date>
    }]
}
This commit is contained in:
Debanjum Singh Solanky
2021-12-08 02:34:52 +05:30
parent 0ac1e5f372
commit 65da7daf1f
3 changed files with 28 additions and 19 deletions

View File

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