Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
[cpacker#319] Refactor memgptlog.py to log.py and move a function to log.py
Max Blackmer5733f0418d87
diff --git a/memgpt/cli/cli.py b/memgpt/cli/cli.pyindex 9196baec3..93b9b3054 100644--- a/memgpt/cli/cli.py+++ b/memgpt/cli/cli.py@@ -13,7 +13,7 @@ from enum import Enumfrom llama_index import set_global_service_contextfrom llama_index import ServiceContext-from memgpt.memgptlog import logger+from memgpt.log import loggerfrom memgpt.interface import CLIInterface as interface # for printing to terminalfrom memgpt.cli.cli_config import configureimport memgpt.presets.presets as presetsdiff --git a/memgpt/cli/cli_config.py b/memgpt/cli/cli_config.pyindex 4b2cc55f3..8203a5e59 100644--- a/memgpt/cli/cli_config.py+++ b/memgpt/cli/cli_config.py@@ -6,7 +6,7 @@ import osimport shutil# from global logging configuration-from memgpt.memgptlog import logger+from memgpt.log import logger# from memgpt.cli import appfrom memgpt import utilsdiff --git a/memgpt/config.py b/memgpt/config.pyindex d81f76e22..804e7bf34 100644--- a/memgpt/config.py+++ b/memgpt/config.py@@ -1,6 +1,6 @@import loggingimport logging.config-from memgpt.memgptlog import logger, reload_logger+from memgpt.log import logger, reload_logger, fix_file_pathimport inspectimport jsonimport osdiff --git a/memgpt/memgptlog.py b/memgpt/log.pysimilarity index 57%rename from memgpt/memgptlog.pyrename to memgpt/log.pyindex 38ae260f1..8151cd990 100644--- a/memgpt/memgptlog.py+++ b/memgpt/log.py@@ -10,3 +10,11 @@ def reload_logger():global logger # This is required to modify the global 'logger'# Reconfigure loggerlogger = logging.getLogger(LOGGER_NAME)+++def fix_file_path(path):+ """+ Converts backslashes to forward slashes in a file path.+ This is useful for ensuring compatibility in file paths across different systems.+ """+ return path.replace("\\", "/")diff --git a/memgpt/main.py b/memgpt/main.pyindex 19ff43c81..d5c2335e5 100644--- a/memgpt/main.py+++ b/memgpt/main.py@@ -17,7 +17,7 @@ from prettytable import PrettyTableconsole = Console()-from memgpt.memgptlog import logger+from memgpt.log import loggerfrom memgpt.interface import CLIInterface as interface # for printing to terminalimport memgpt.agent as agentimport memgpt.system as systemdiff --git a/memgpt/utils.py b/memgpt/utils.pyindex 5b720d83e..8e864a423 100644--- a/memgpt/utils.py+++ b/memgpt/utils.py@@ -288,11 +288,3 @@ def get_schema_diff(schema_a, schema_b):difference = [line for line in difference if line.startswith("+ ") or line.startswith("- ")]return "".join(difference)---def fix_file_path(path):- """- Converts backslashes to forward slashes in a file path.- This is useful for ensuring compatibility in file paths across different systems.- """- return path.replace("\\", "/")