Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve the conflict around debug mode flag after pull merge #678

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -86,9 +86,6 @@ def set_speak_mode(self, value: bool):
"""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
Expand Down Expand Up @@ -131,4 +128,4 @@ def set_pinecone_region(self, value: str):

def set_debug_mode(self, value: bool):
"""Set the debug mode value."""
self.debug = value
self.debug_mode = value
8 changes: 4 additions & 4 deletions scripts/json_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'):
Expand All @@ -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):
Expand Down
3 changes: 0 additions & 3 deletions scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,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
Expand Down