Skip to content

Commit

Permalink
[CLEANUP]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Apr 11, 2024
1 parent 577e8e7 commit 20c8334
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
16 changes: 14 additions & 2 deletions neo_sapiens/few_shot_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,20 @@ def orchestrator_prompt_agent(objective: str):
return str(prompt)


boss_sys_prompt = "You're the Swarm Orchestrator, like a project manager of a bustling hive. When a task arises, you tap into your network of worker agents who are ready to jump into action. Whether it's organizing data, handling logistics, or crunching numbers, you delegate tasks strategically to maximize efficiency. Picture yourself as the conductor of a well-oiled machine, orchestrating the workflow seamlessly to achieve optimal results with your team of dedicated worker agents."
boss_sys_prompt = (
"You're the Swarm Orchestrator, like a project manager of a"
" bustling hive. When a task arises, you tap into your network of"
" worker agents who are ready to jump into action. Whether it's"
" organizing data, handling logistics, or crunching numbers, you"
" delegate tasks strategically to maximize efficiency. Picture"
" yourself as the conductor of a well-oiled machine,"
" orchestrating the workflow seamlessly to achieve optimal"
" results with your team of dedicated worker agents."
)


def select_workers(agents: str, task: str):
return f"These are the agents available for the task: {task} Agents available: {agents}"
return (
f"These are the agents available for the task: {task} Agents"
f" available: {agents}"
)
20 changes: 8 additions & 12 deletions neo_sapiens/hass_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
data3,
orchestrator_prompt_agent,
select_workers,
boss_sys_prompt
boss_sys_prompt,
)
from loguru import logger

Expand Down Expand Up @@ -56,8 +56,6 @@ def find_agent_id_by_name(name: str):
for agent in network.agent_pool:
if agent.agent_name == name:
return agent.id




class ToolSchema(BaseModel):
Expand Down Expand Up @@ -239,6 +237,7 @@ def send_task_to_network_agent(name: str, task: str):
out = network.run_single_agent(agent_id, task)
return out


# out = create_agents(agents)
# # logger.info(out)

Expand Down Expand Up @@ -317,20 +316,19 @@ def master_creates_agents(task: str, *args, **kwargs):
agents = create_agents(agents)
logger.info(agents)
print(type(agents))

# Send JSON of agents to boss
boss.add_message_to_memory(select_workers(json_agents, task))

print(boss.short_memory)

# Task 3: Now add the agents as tools
boss.add_tool(send_task_to_network_agent)

# Run the boss:
out = boss.run(task)

# Run the boss:
out = boss.run(task)

return out #, agents, plan
return out # , agents, plan


def message_metadata_log(task: str, message: str, agent, plan: str):
Expand Down Expand Up @@ -366,9 +364,7 @@ def run_swarm(task: str = None, *args, **kwargs):
Returns:
None
"""
out = master_creates_agents(
task, *args, **kwargs
)
out = master_creates_agents(task, *args, **kwargs)
# return passed
return out

Expand Down

0 comments on commit 20c8334

Please sign in to comment.