Skip to content

Commit

Permalink
swapping out hardcoded str for prefix (forgot to include in #569)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacker committed Dec 4, 2023
1 parent d8af092 commit ff6c84f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions memgpt/functions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ def load_all_function_sets(merge=True):
except ModuleNotFoundError as e:
# Handle missing module imports
missing_package = str(e).split("'")[1] # Extract the name of the missing package
print(f"Warning: skipped loading python file '{module_full_path}'!")
print(f"{CLI_WARNING_PREFIX}skipped loading python file '{module_full_path}'!")
print(
f"'{file}' imports '{missing_package}', but '{missing_package}' is not installed locally - install python package '{missing_package}' to link functions from '{file}' to MemGPT."
)
continue
except SyntaxError as e:
# Handle syntax errors in the module
print(f"Warning: skipped loading python file '{file}' due to a syntax error: {e}")
print(f"{CLI_WARNING_PREFIX}skipped loading python file '{file}' due to a syntax error: {e}")
continue
except Exception as e:
# Handle other general exceptions
print(f"Warning: skipped loading python file '{file}': {e}")
print(f"{CLI_WARNING_PREFIX}skipped loading python file '{file}': {e}")
continue
else:
# For built-in scripts, use the existing method
Expand All @@ -89,7 +89,7 @@ def load_all_function_sets(merge=True):
module = importlib.import_module(full_module_name)
except Exception as e:
# Handle other general exceptions
print(f"Warning: skipped loading python module '{full_module_name}': {e}")
print(f"{CLI_WARNING_PREFIX}skipped loading python module '{full_module_name}': {e}")
continue

try:
Expand Down

0 comments on commit ff6c84f

Please sign in to comment.