Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Apr 3, 2024
1 parent facdb19 commit 8ba6072
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
35 changes: 35 additions & 0 deletions configs/debate_voice_clone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"background": "Six agents gather outside at a bus stop to chat with each other. They talk about their interests and anything they come up with.",
"actions_blacklist": [ "move" ],
"agents": [
{
"name": "Natasha",
"description": "Natasha thinks AI is evil",
"goal": "",
"connections": [
"Sherlock",
"Viktor",
"Lily",
"James"
],
"x": 25,
"y": 10
},
{
"name": "James",
"description": "James thinks AI is a futurist and thinks AI will save our world",
"goal": "",
"connections": [
"Sherlock",
"Viktor",
"Lily",
"Natasha"
],
"x": 25,
"y": 15
}
],
"steps": 10,
"allow_movement": 0,
"perception_range": 50
}
5 changes: 3 additions & 2 deletions src/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def __init__(self, config={}):
#self.environment.overlay_collisions_on_image()
self.background = None
print(config)
print(f"steps {self.steps}")

def boot(self):
# Add Agents
Expand Down Expand Up @@ -251,8 +252,8 @@ def run_singlethread(self):
start_time = datetime.now()
pd(f"Step {step + 1}:")

if redis_connection:
control_cmd = redis_connection.lpop(f"{self.id}:communications")
if self.redis_connection:
control_cmd = self.redis_connection.lpop(f"{self.id}:communications")
if control_cmd:
control_cmd_str = control_cmd.decode('utf-8')
try:
Expand Down
2 changes: 0 additions & 2 deletions src/npc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@


class Npc(Agent):
simulation_id = 42

def __init__(self, agent_data):
self.id = str(uuid.uuid4())
self.name = agent_data.get('name', "")
Expand Down
6 changes: 0 additions & 6 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,6 @@ def prompt(self, prompt_name, variables=None, fallback="Llm Error"):
'''
REDIS
'''
#TODO get rid of globals
if "REDIS_URL" in globals():
redis_connection = redis.Redis.from_url(REDIS_URL)
else:
print("REDIS_URL environment variable is not set.")
redis_connection = None

def print_and_log(content, key):
return
Expand Down

0 comments on commit 8ba6072

Please sign in to comment.