worker_name:Optional[str]="Swarm Worker AI Assistant",
worker_name:Optional[str]="Swarm Worker AI Assistant",
verbose:Optional[bool]=False,
verbose:Optional[bool]=False,
human_in_the_loop:Optional[bool]=True,
human_in_the_loop:Optional[bool]=True,
boss_prompt:Optional[str]="You are an Boss in a swarm who performs one task based on the following objective: {objective}. Take into account these previously completed tasks: {context}.\n",
boss_prompt:Optional[str]="You are an Boss in a swarm who performs one task based on the following objective: {objective}. Take into account these previously completed tasks: {context}.\n",
worker_node_tool=Tool(name="WorkerNode AI Agent",func=worker_node.run,description=worker_descriptionor"Input: an objective with a todo list for that objective. Output: your task completed: Please be very clear what the objective and task instructions are. The Swarm worker agent is Useful for when you need to spawn an autonomous agent instance as a worker to accomplish any complex tasks, it can search the internet or write code or spawn child multi-modality models to process and generate images and text or audio and so on")
returnworker_node_tool
exceptExceptionase:
logging.error(f"Failed to initialize worker node: {e}")
Tool(name="TODO",func=todo_chain.run,description="useful for when you need to come up with todo lists. Input: an objective to create a todo list for your objective. Note create a todo list then assign a ranking from 0.0 to 1.0 to each task, then sort the tasks based on the tasks most likely to achieve the objective. The Output: a todo list for that objective with rankings for each step from 0.1 Please be very clear what the objective is!"),
worker_node,
]
suffix="""Question: {task}\n{agent_scratchpad}"""
prefix="""You are an Boss in a swarm who performs one task based on the following objective: {objective}. Take into account these previously completed tasks: {context}.\n"""
# worker_name: Optional[str] = "Swarm Worker AI Assistant",
# verbose: Optional[bool] = False,
# human_in_the_loop: Optional[bool] = True,
# boss_prompt: Optional[str] = "You are an Boss in a swarm who performs one task based on the following objective: {objective}. Take into account these previously completed tasks: {context}.\n",
# worker_node_tool = Tool(name="WorkerNode AI Agent", func=worker_node.run, description= worker_description or "Input: an objective with a todo list for that objective. Output: your task completed: Please be very clear what the objective and task instructions are. The Swarm worker agent is Useful for when you need to spawn an autonomous agent instance as a worker to accomplish any complex tasks, it can search the internet or write code or spawn child multi-modality models to process and generate images and text or audio and so on")
# return worker_node_tool
# except Exception as e:
# logging.error(f"Failed to initialize worker node: {e}")
# Tool(name="TODO", func=todo_chain.run, description="useful for when you need to come up with todo lists. Input: an objective to create a todo list for your objective. Note create a todo list then assign a ranking from 0.0 to 1.0 to each task, then sort the tasks based on the tasks most likely to achieve the objective. The Output: a todo list for that objective with rankings for each step from 0.1 Please be very clear what the objective is!"),
# prefix = """You are an Boss in a swarm who performs one task based on the following objective: {objective}. Take into account these previously completed tasks: {context}.\n """
logging.error(f"Failed to initialize vector store: {e}")
raise
defcreate_worker_node(self,llm_class=ChatOpenAI,ai_name="Swarm Worker AI Assistant",ai_role="Assistant",human_in_the_loop=False,search_kwargs={},verbose=False):
defcreate_worker_node(self,llm_class=ChatOpenAI,ai_name="Swarm Worker AI Assistant",ai_role="Assistant",human_in_the_loop=False,search_kwargs={},verbose=False):