add better print options
This commit is contained in:
@@ -3,6 +3,7 @@ import psycopg
|
|||||||
from typing import List, Dict, Union
|
from typing import List, Dict, Union
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import os
|
import os
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
from langchain_core.messages import HumanMessage, AIMessage, ToolMessage, SystemMessage, BaseMessage
|
from langchain_core.messages import HumanMessage, AIMessage, ToolMessage, SystemMessage, BaseMessage
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ class ConversationPrinter:
|
|||||||
inp = [e for e in inp if not isinstance(e, SystemMessage)]
|
inp = [e for e in inp if not isinstance(e, SystemMessage)]
|
||||||
curr_len = self.id_dic.get(conv_id, 0)
|
curr_len = self.id_dic.get(conv_id, 0)
|
||||||
to_print_msg = inp[curr_len:]
|
to_print_msg = inp[curr_len:]
|
||||||
|
print("\n")
|
||||||
for msg in to_print_msg:
|
for msg in to_print_msg:
|
||||||
msg.pretty_print()
|
msg.pretty_print()
|
||||||
|
|
||||||
@@ -110,3 +112,8 @@ CONV_STORE = ConversationStore()
|
|||||||
def use_printer():
|
def use_printer():
|
||||||
global CONV_STORE
|
global CONV_STORE
|
||||||
CONV_STORE = ConversationPrinter()
|
CONV_STORE = ConversationPrinter()
|
||||||
|
|
||||||
|
|
||||||
|
def print_store_type():
|
||||||
|
global CONV_STORE
|
||||||
|
logger.info(CONV_STORE)
|
||||||
|
|||||||
Reference in New Issue
Block a user