Skip to content

Commit d184d0d

Browse files
authored
Implement Logging of User Input in logs/Debug Folder (Significant-Gravitas#3867)
* Adds USER_INPUT_FILE_NAME * Update agent.py * Update agent.py Log only if console_input is not the authorise_key * Reformatting
1 parent 06317df commit d184d0d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

autogpt/agent/agent.py

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from autogpt.log_cycle.log_cycle import (
1212
FULL_MESSAGE_HISTORY_FILE_NAME,
1313
NEXT_ACTION_FILE_NAME,
14+
USER_INPUT_FILE_NAME,
1415
LogCycleHandler,
1516
)
1617
from autogpt.logs import logger, print_assistant_thoughts
@@ -215,6 +216,13 @@ def start_interaction_loop(self):
215216
else:
216217
user_input = console_input
217218
command_name = "human_feedback"
219+
self.log_cycle_handler.log_cycle(
220+
self.config.ai_name,
221+
self.created_at,
222+
self.cycle_count,
223+
user_input,
224+
USER_INPUT_FILE_NAME,
225+
)
218226
break
219227

220228
if user_input == "GENERATE NEXT COMMAND JSON":

autogpt/log_cycle/log_cycle.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
NEXT_ACTION_FILE_NAME = "next_action.json"
1111
PROMPT_SUMMARY_FILE_NAME = "prompt_summary.json"
1212
SUMMARY_FILE_NAME = "summary.txt"
13+
USER_INPUT_FILE_NAME = "user_input.txt"
1314

1415

1516
class LogCycleHandler:

0 commit comments

Comments
 (0)