Merge pull request #89 from Mirza-Samad-Ahmed-Baig/fixes

Enhancement: agent reflection, logging improvement
This commit is contained in:
Yijia Xiao 2025-07-03 10:15:39 -04:00 committed by GitHub
commit 7e0fca554f
2 changed files with 6 additions and 3 deletions

View File

@ -16,8 +16,11 @@ def create_trader(llm, memory):
past_memories = memory.get_memories(curr_situation, n_matches=2) past_memories = memory.get_memories(curr_situation, n_matches=2)
past_memory_str = "" past_memory_str = ""
for i, rec in enumerate(past_memories, 1): if past_memories:
past_memory_str += rec["recommendation"] + "\n\n" for i, rec in enumerate(past_memories, 1):
past_memory_str += rec["recommendation"] + "\n\n"
else:
past_memory_str = "No past memories found."
context = { context = {
"role": "user", "role": "user",

View File

@ -226,7 +226,7 @@ class TradingAgentsGraph:
directory.mkdir(parents=True, exist_ok=True) directory.mkdir(parents=True, exist_ok=True)
with open( with open(
f"eval_results/{self.ticker}/TradingAgentsStrategy_logs/full_states_log.json", f"eval_results/{self.ticker}/TradingAgentsStrategy_logs/full_states_log_{trade_date}.json",
"w", "w",
) as f: ) as f:
json.dump(self.log_states_dict, f, indent=4) json.dump(self.log_states_dict, f, indent=4)