dataclass wraps functions that accept a single string input and returns a string output.# Load the tool configs that are needed.search = SerpAPIWrapper()llm_math_chain = LLMMathChain(llm=llm, verbose=True)tools = [    Tool.from_function(        func=search.run,        name="Search",        description="useful for when you need to answer questions about current events"        # coroutine= ... <- you can specify an async method if desired as well    ),]    /Users/wfh/code/lc/lckg/langchain/chains/llm_math/base.py:50: UserWarning: Directly instantiating an LLMMathChain with an llm is deprecated. Please instantiate with llm_chain argument or using the from_llm class method.      warnings.warn(You can also define a custom args_schema to provide more information about inputs.from pydantic import BaseModel, Fieldclass CalculatorInput(BaseModel):    question: str = Field()tools.append(    Tool.from_function(        func=llm_math_chain.run,        name="Calculator",        description="useful for when you need to answer questions about math",        args_schema=CalculatorInput        # coroutine= ... <- you can specify an async method if desired as well    ))# Construct the agent. We will use the default agent type here.# See documentation for a full list of options.agent = initialize_agent(    tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)agent.run(    "Who is Leo DiCaprio's girlfriend? What is her current age raised to the 0.43 power?")            > Entering new AgentExecutor chain...    I need to find out Leo DiCaprio's girlfriend's name and her age    Action: Search    Action Input: "Leo DiCaprio girlfriend"    Observation: After rumours of a romance with Gigi Hadid, the Oscar winner has seemingly moved on. First being linked to the television personality in September 2022, it appears as if his "age bracket" has moved up. This follows his rumoured relationship with mere 19-year-old Eden Polani.    Thought:I still need to find out his current
When constructing your own agent, you will need to provide it with a list of Tools that it can use. Besides the actual function that is called, the Tool consists of several components:
When constructing your own agent, you will need to provide it with a list of Tools that it can use. Besides the actual function that is called, the Tool consists of several components: ->: dataclass wraps functions that accept a single string input and returns a string output.# Load the tool configs that are needed.search = SerpAPIWrapper()llm_math_chain = LLMMathChain(llm=llm, verbose=True)tools = [    Tool.from_function(        func=search.run,        name="Search",        description="useful for when you need to answer questions about current events"        # coroutine= ... <- you can specify an async method if desired as well    ),]    /Users/wfh/code/lc/lckg/langchain/chains/llm_math/base.py:50: UserWarning: Directly instantiating an LLMMathChain with an llm is deprecated. Please instantiate with llm_chain argument or using the from_llm class method.      warnings.warn(You can also define a custom args_schema to provide more information about inputs.from pydantic import BaseModel, Fieldclass CalculatorInput(BaseModel):    question: str = Field()tools.append(    Tool.from_function(        func=llm_math_chain.run,        name="Calculator",        description="useful for when you need to answer questions about math",        args_schema=CalculatorInput        # coroutine= ... <- you can specify an async method if desired as well    ))# Construct the agent. We will use the default agent type here.# See documentation for a full list of options.agent = initialize_agent(    tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)agent.run(    "Who is Leo DiCaprio's girlfriend? What is her current age raised to the 0.43 power?")            > Entering new AgentExecutor chain...    I need to find out Leo DiCaprio's girlfriend's name and her age    Action: Search    Action Input: "Leo DiCaprio girlfriend"    Observation: After rumours of a romance with Gigi Hadid, the Oscar winner has seemingly moved on. First being linked to the television personality in September 2022, it appears as if his "age bracket" has moved up. This follows his rumoured relationship with mere 19-year-old Eden Polani.    Thought:I still need to find out his current