From 0a894c896f319c81af570ad8c778bfc5b7b5e323 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Thu, 28 Dec 2023 12:06:20 -0800 Subject: [PATCH] updated CLI interface to properly print searches on archival memory + recall memory (#731) --- memgpt/interface.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/memgpt/interface.py b/memgpt/interface.py index c8da15bb42..e0b1b6f5fa 100644 --- a/memgpt/interface.py +++ b/memgpt/interface.py @@ -159,8 +159,11 @@ def printd_function_message(icon, msg, color=Fore.RED): if match: function_name = match.group(1) function_args = match.group(2) - if "memory" in function_name: - print_function_message("🧠", f"updating memory with {function_name}") + if function_name in ["archival_memory_insert", "archival_memory_search"]: + if function_name == "archival_memory_insert": + print_function_message("🧠", f"updating memory with {function_name}") + elif function_name == "archival_memory_search": + print_function_message("🧠", f"searching memory with {function_name}") try: msg_dict = eval(function_args) if function_name == "archival_memory_search": @@ -186,6 +189,19 @@ def printd_function_message(icon, msg, color=Fore.RED): printd(str(e)) printd(msg_dict) pass + elif function_name in ["conversation_search", "conversation_search_date"]: + print_function_message("🧠", f"searching memory with {function_name}") + try: + msg_dict = eval(function_args) + output = f'\tquery: {msg_dict["query"]}, page: {msg_dict["page"]}' + if STRIP_UI: + print(output) + else: + print(f"{Fore.RED}{output}{Style.RESET_ALL}") + except Exception as e: + printd(str(e)) + printd(msg_dict) + pass else: printd(f"{CLI_WARNING_PREFIX}did not recognize function message") printd_function_message("", msg)