Thought:I still need to find out his current girlfriend's name and age    Action: Search    Action Input: "Leo DiCaprio current girlfriend"    Observation: Just Jared on Instagram: ‚ÄúLeonardo DiCaprio & girlfriend Camila Morrone couple up for a lunch date!    Thought:Now that I know his girlfriend's name is Camila Morrone, I need to find her current age    Action: Search    Action Input: "Camila Morrone age"    Observation: 25 years    Thought:Now that I have her age, I need to calculate her age raised to the 0.43 power    Action: Calculator    Action Input: 25^(0.43)        > Entering new LLMMathChain chain...    25^(0.43)```text    25**(0.43)    ```    ...numexpr.evaluate("25**(0.43)")...        Answer: 3.991298452658078    > Finished chain.        Observation: Answer: 3.991298452658078    Thought:I now know the final answer    Final Answer: Camila Morrone's current age raised to the 0.43 power is approximately 3.99.        > Finished chain.    "Camila Morrone's current age raised to the 0.43 power is approximately 3.99."Subclassing the BaseTool class‚ÄãYou can also directly subclass BaseTool. This is useful if you want more control over the instance variables or if you want to propagate callbacks to nested chains or other tools.from typing import Optional, Typefrom langchain.callbacks.manager import (    AsyncCallbackManagerForToolRun,    CallbackManagerForToolRun,)class CustomSearchTool(BaseTool):    name = "custom_search"    description = "useful for when you need to answer questions about current events"    def _run(        self, query: str, run_manager: Optional[CallbackManagerForToolRun] = None    ) -> str:        """Use the tool."""        return search.run(query)    async def _arun(        self, query: str, run_manager: Optional[AsyncCallbackManagerForToolRun] = None    ) -> str:        """Use the tool asynchronously."""        raise NotImplementedError("custom_search does not support async")class CustomCalculatorTool(BaseTool):    name = "Calculator"
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: ->: Thought:I still need to find out his current girlfriend's name and age    Action: Search    Action Input: "Leo DiCaprio current girlfriend"    Observation: Just Jared on Instagram: ‚ÄúLeonardo DiCaprio & girlfriend Camila Morrone couple up for a lunch date!    Thought:Now that I know his girlfriend's name is Camila Morrone, I need to find her current age    Action: Search    Action Input: "Camila Morrone age"    Observation: 25 years    Thought:Now that I have her age, I need to calculate her age raised to the 0.43 power    Action: Calculator    Action Input: 25^(0.43)        > Entering new LLMMathChain chain...    25^(0.43)```text    25**(0.43)    ```    ...numexpr.evaluate("25**(0.43)")...        Answer: 3.991298452658078    > Finished chain.        Observation: Answer: 3.991298452658078    Thought:I now know the final answer    Final Answer: Camila Morrone's current age raised to the 0.43 power is approximately 3.99.        > Finished chain.    "Camila Morrone's current age raised to the 0.43 power is approximately 3.99."Subclassing the BaseTool class‚ÄãYou can also directly subclass BaseTool. This is useful if you want more control over the instance variables or if you want to propagate callbacks to nested chains or other tools.from typing import Optional, Typefrom langchain.callbacks.manager import (    AsyncCallbackManagerForToolRun,    CallbackManagerForToolRun,)class CustomSearchTool(BaseTool):    name = "custom_search"    description = "useful for when you need to answer questions about current events"    def _run(        self, query: str, run_manager: Optional[CallbackManagerForToolRun] = None    ) -> str:        """Use the tool."""        return search.run(query)    async def _arun(        self, query: str, run_manager: Optional[AsyncCallbackManagerForToolRun] = None    ) -> str:        """Use the tool asynchronously."""        raise NotImplementedError("custom_search does not support async")class CustomCalculatorTool(BaseTool):    name = "Calculator"