diff --git a/swarms/agents/workers/worker.py b/swarms/agents/workers/worker.py index cb097446..89fedeaf 100644 --- a/swarms/agents/workers/worker.py +++ b/swarms/agents/workers/worker.py @@ -6,16 +6,21 @@ from langchain.callbacks.manager import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) -from typing import List, Any, Dict +from typing import List, Any, Dict, Optional from langchain.memory.chat_message_histories import FileChatMessageHistory import logging +from pydantic import BaseModel, Extra logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') class WorkerNodeArgs(BaseModel): prompt: str run_manager: Optional[CallbackManagerForToolRun] = None + class Config: + arbitrary_types_allowed = True + extra = Extra.forbid + @tool("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"""