This commit is contained in:
Richard Beales
2023-04-09 15:23:05 +01:00
3 changed files with 10 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ class Config(metaclass=Singleton):
"""
def __init__(self):
self.debug = False
self.continuous_mode = False
self.speak_mode = False
# TODO - make these models be self-contained, using langchain, so we can configure them once and call it good
@@ -110,3 +111,6 @@ class Config(metaclass=Singleton):
def set_pinecone_region(self, value: str):
self.pinecone_region = value
def set_debug_mode(self, value: bool):
self.debug = value

View File

@@ -40,7 +40,7 @@ def fix_and_parse_json(json_str: str, try_to_fix_with_gpt: bool = True):
if try_to_fix_with_gpt:
print(f"Warning: Failed to parse AI output, attempting to fix.\n If you see this warning frequently, it's likely that your prompt is confusing the AI. Try changing it up slightly.")
# Now try to fix this up using the ai_functions
ai_fixed_json = fix_json(json_str, json_schema, False)
ai_fixed_json = fix_json(json_str, json_schema, cfg.debug)
if ai_fixed_json != "failed":
return json.loads(ai_fixed_json)
else:

View File

@@ -276,6 +276,10 @@ 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
@@ -306,7 +310,7 @@ while True:
user_input,
full_message_history,
memory,
cfg.fast_token_limit) # TODO: This hardcodes the model to use GPT3.5. Make this an argument
cfg.fast_token_limit, cfg.debug) # TODO: This hardcodes the model to use GPT3.5. Make this an argument
# Print Assistant thoughts
print_assistant_thoughts(assistant_reply)