Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Resolve the conflict around debug mode flag after pull merge

kinance5b2d6010dc59
diff --git a/scripts/config.py b/scripts/config.py
index 1eb74b2bc7..50432c425f 100644
--- a/scripts/config.py
+++ b/scripts/config.py
@@ -33,7 +33,7 @@ class Config(metaclass=Singleton):
def __init__(self):
"""Initialize the Config class"""
- self.debug = False
+ self.debug_mode = False
self.continuous_mode = False
self.speak_mode = False
@@ -86,9 +86,6 @@ class Config(metaclass=Singleton):
"""Set the speak mode value."""
self.speak_mode = value
- def set_debug_mode(self, value: bool):
- self.debug_mode = value
-
def set_fast_llm_model(self, value: str):
"""Set the fast LLM model value."""
self.fast_llm_model = value
@@ -131,4 +128,4 @@ class Config(metaclass=Singleton):
def set_debug_mode(self, value: bool):
"""Set the debug mode value."""
- self.debug = value
+ self.debug_mode = value
diff --git a/scripts/json_utils.py b/scripts/json_utils.py
index b3ffe4b9ab..9f26970eaa 100644
--- a/scripts/json_utils.py
+++ b/scripts/json_utils.py
@@ -88,7 +88,7 @@ def fix_invalid_escape(json_str: str, error_message: str) -> str:
json.loads(json_str)
return json_str
except json.JSONDecodeError as e:
- if cfg.debug:
+ if cfg.debug_mode:
print('json loads error - fix invalid escape', e)
error_message = str(e)
return json_str
@@ -103,12 +103,12 @@ def correct_json(json_str: str) -> str:
"""
try:
- if cfg.debug:
+ if cfg.debug_mode:
print("json", json_str)
json.loads(json_str)
return json_str
except json.JSONDecodeError as e:
- if cfg.debug:
+ if cfg.debug_mode:
print('json loads error', e)
error_message = str(e)
if error_message.startswith('Invalid \\escape'):
@@ -119,7 +119,7 @@ def correct_json(json_str: str) -> str:
json.loads(json_str)
return json_str
except json.JSONDecodeError as e:
- if cfg.debug:
+ if cfg.debug_mode:
print('json loads error - add quotes', e)
error_message = str(e)
if balanced_str := balance_braces(json_str):
diff --git a/scripts/main.py b/scripts/main.py
index 844c2375d2..34750fa04d 100644
--- a/scripts/main.py
+++ b/scripts/main.py
@@ -285,9 +285,6 @@ def parse_arguments():
print_to_console("GPT3.5 Only Mode: ", Fore.GREEN, "ENABLED")
cfg.set_smart_llm_model(cfg.fast_llm_model)
- if args.debug:
- print_to_console("Debug Mode: ", Fore.GREEN, "ENABLED")
- cfg.set_debug_mode(True)
# TODO: fill in llm values here
@@ -318,7 +315,7 @@ while True:
user_input,
full_message_history,
memory,
- cfg.fast_token_limit, cfg.debug) # TODO: This hardcodes the model to use GPT3.5. Make this an argument
+ cfg.fast_token_limit) # TODO: This hardcodes the model to use GPT3.5. Make this an argument
# Print Assistant thoughts
print_assistant_thoughts(assistant_reply)