Skip to content

Commit

Permalink
renamed to action_history to differ from task history
Browse files Browse the repository at this point in the history
  • Loading branch information
qcampbel committed Feb 5, 2024
1 parent 1aa8ed5 commit 10308c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mdagent/subagents/subagent_fxns.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(
self.ckpt_dir = subagent_settings.ckpt_dir
self.all_tools_string = all_tools_string
self.current_tools = current_tools
os.makedirs(f"{self.ckpt_dir}/history/", exist_ok=True)
os.makedirs(f"{self.ckpt_dir}/action_history/", exist_ok=True)

# initialize agents
initializer = SubAgentInitializer(subagent_settings)
Expand Down Expand Up @@ -62,13 +62,13 @@ def _add_to_history(
def _save_failures(self, history, msg):
if msg is None:
# save to file
with open(f"{self.ckpt_dir}/history/failed_history.json", "a") as f:
with open(f"{self.ckpt_dir}/action_history/failed_history.json", "a") as f:
history_string = json.dumps(history)
f.write("\n" + history_string + "\n")
return "failed history saved to file"
else:
# save to file
with open(f"{self.ckpt_dir}/history/failed_history.json", "a") as f:
with open(f"{self.ckpt_dir}/action_history/failed_history.json", "a") as f:
f.write("\n" + msg + "\n")
return None

Expand Down Expand Up @@ -172,8 +172,8 @@ def _pull_information(self):
# pull info of strings to pass to llm agents
recent_history_string = ""
full_history_string = ""
if os.path.exists(f"{self.ckpt_dir}/history/failed_history.json"):
with open(f"{self.ckpt_dir}/history/failed_history.json", "r") as f:
if os.path.exists(f"{self.ckpt_dir}/action_history/failed_history.json"):
with open(f"{self.ckpt_dir}/action_history/failed_history.json", "r") as f:
full_history_string = f.read()
lines = full_history_string.splitlines()
recent_history_string = lines[-1] if lines else None
Expand Down Expand Up @@ -241,7 +241,7 @@ def _pull_information(self):
"files": files,
"current_tools": self.current_tools, # -> skill_manager.get_current_tools()
"all_tools": self.all_tools_string, # -> skill_manager.get_all_tools()
# # below depends on task_history implmentation
# # below depends on task_history implementation
# "succeeded_tasks": succeeded_tasks,
# "failed_task": failed_task,
# "failed_tool": failed_tool,
Expand Down

0 comments on commit 10308c2

Please sign in to comment.