Skip to content

Commit

Permalink
Added a little structure to the agent_set call
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacadam committed Feb 13, 2024
1 parent 9eec85d commit 92296c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def kill(self, other_agent, timestamp):
print(f"{self} killed {other_agent}")
other_agent.status = "dead"
if self.matrix:
self.matrix.add_to_logs({"agent_id":self.mid,"step_type":"agent_set","status":"dead"})
self.matrix.add_to_logs({"agent_id":self.mid,"step_type":"agent_set", "attribute_name": "status", "status":"dead"})
self.addMemory("interaction",f"{self} successfully killed {other_agent}",timestamp, 9)
other_agent.addMemory("interaction",f"{self} killed you",timestamp, 9)
else:
Expand Down Expand Up @@ -304,7 +304,7 @@ def summarize_conversation(self, timestamp):
print_and_log(interaction, f"{self.matrix.id}:events:{self.name}")

self.addMemory("conversation", interaction, timestamp, random.randint(4, 6))
self.matrix.add_to_logs({"step_type":"agent_set","convo":"complete","from":self.mid,"to":self.last_conversation.other_agent.mid,"convo_id":self.last_conversation.mid})
self.matrix.add_to_logs({"step_type":"agent_set", "attribute_name": "convo", "attribute_data": {"status": "complete", "from":self.mid, "to":self.last_conversation.other_agent.mid, "convo_id":self.last_conversation.mid}})
self.last_conversation = None

def talk(self, opts={}):
Expand Down

0 comments on commit 92296c1

Please sign in to comment.