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

refactor debug to debug_mode #805

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions scripts/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ def chat_with_ai(
model = cfg.fast_llm_model # TODO: Change model from hardcode to argument
# Reserve 1000 tokens for the response

if cfg.debug:
if cfg.debug_mode:
print(f"Token limit: {token_limit}")

send_token_limit = token_limit - 1000

relevant_memory = permanent_memory.get_relevant(str(full_message_history[-5:]), 10)

if cfg.debug:
if cfg.debug_mode:
print('Memory Stats: ', permanent_memory.get_stats())

next_message_to_add_index, current_tokens_used, insertion_index, current_context = generate_context(
Expand Down Expand Up @@ -110,7 +110,7 @@ def chat_with_ai(
# assert tokens_remaining >= 0, "Tokens remaining is negative. This should never happen, please submit a bug report at https://www.github.com/Torantulino/Auto-GPT"

# Debug print the current context
if cfg.debug:
if cfg.debug_mode:
print(f"Token limit: {token_limit}")
print(f"Send Token Count: {current_tokens_used}")
print(f"Tokens remaining for response: {tokens_remaining}")
Expand Down
2 changes: 1 addition & 1 deletion scripts/json_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def fix_json(json_str: str, schema: str) -> str:
result_string = call_ai_function(
function_string, args, description_string, model=cfg.fast_llm_model
)
if cfg.debug:
if cfg.debug_mode:
print("------------ JSON FIX ATTEMPT ---------------")
print(f"Original JSON: {json_str}")
print("-----------")
Expand Down