diff --git a/swarms/agents/workers/worker_agent.py b/swarms/agents/workers/worker_agent.py index e51d574f..8d10013e 100644 --- a/swarms/agents/workers/worker_agent.py +++ b/swarms/agents/workers/worker_agent.py @@ -1,21 +1,13 @@ from swarms.tools.agent_tools import * -from langchain.tools import BaseTool +from langchain.tools import BaseTool, tool from typing import Optional, Type from langchain.callbacks.manager import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) -from langchain.tools import tool - -# ---------- Worker Node ---------- -from pydantic import Field -# -@tool -class WorkerNode(): +class WorkerNode(BaseTool): """Useful for when you need to spawn an autonomous agent instance as a worker to accomplish complex tasks, it can search the internet or spawn child multi-modality models to process and generate images and text or audio and so on """ - # name = "WorkerNode" - # description = "Useful for when you need to spawn an autonomous agent instance as a worker to accomplish complex tasks, it can search the internet or spawn child multi-modality models to process and generate images and text or audio and so on." def __init__(self, llm, tools, vectorstore): super().__init__() @@ -34,6 +26,10 @@ class WorkerNode(): ) self.agent.chain.verbose = True + @tool( + name="Worker AutoBot Agent", + description="Useful for when you need to spawn an autonomous agent instance as a worker to accomplish complex tasks, it can search the internet or spawn child multi-modality models to process and generate images and text or audio and so on", + ) def _run( self, prompt: str, run_manager: Optional[CallbackManagerForToolRun] = None ) -> str: