classBaseAgent(BaseComponent):"""Define base agent interface"""name:str=Param(help="Name of the agent.")agent_type:AgentType=Param(help="Agent type, must be one of AgentType")description:str=Param(help=("Description used to tell the model how/when/why to use the agent. You can"" provide few-shot examples as a part of the description. This will be"" input to the prompt of LLM."))llm:Optional[BaseLLM]=Node(help=("LLM to be used for the agent (optional). LLM must implement BaseLLM"" interface."))prompt_template:Optional[Union[PromptTemplate,dict[str,PromptTemplate]]]=Param(help="A prompt template or a dict to supply different prompt to the agent")plugins:list[BaseTool]=Param(default_callback=lambda_:[],help="List of plugins / tools to be used in the agent",)@staticmethoddefsafeguard_run(run_func,*args,**kwargs):defwrapper(self,*args,**kwargs):try:returnrun_func(self,*args,**kwargs)exceptExceptionase:returnAgentOutput(text="",agent_type=self.agent_type,status="failed",error=str(e),)returnwrapperdefadd_tools(self,tools:list[BaseTool])->None:"""Helper method to add tools and update agent state if needed"""self.plugins.extend(tools)defrun(self,*args,**kwargs)->AgentOutput|list[AgentOutput]:"""Run the component."""raiseNotImplementedError()