func=search_tool3.run,        name="Search_tool3",        description="useful for when you need to answer questions about current events",    ),]agent = initialize_agent(    tools,    ChatOpenAI(temperature=0),    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,    verbose=True,)agent.run("Who is Leo DiCaprio's girlfriend?")            > Entering new AgentExecutor chain...    I should use Search_tool1 to find recent news articles about Leo DiCaprio's personal life.    Action: Search_tool1    Action Input: "Leo DiCaprio girlfriend"    Observation: The search tool1 is not available.    Thought:I should try using Search_tool2 instead.    Action: Search_tool2    Action Input: "Leo DiCaprio girlfriend"    Observation: The following errors occurred during tool execution:The search tool2 is not available.Please try another tool.    Thought:I should try using Search_tool3 as a last resort.    Action: Search_tool3    Action Input: "Leo DiCaprio girlfriend"    Observation: Leonardo DiCaprio and Gigi Hadid were recently spotted at a pre-Oscars party, sparking interest once again in their rumored romance. The Revenant actor and the model first made headlines when they were spotted together at a New York Fashion Week afterparty in September 2022.    Thought:Based on the information from Search_tool3, it seems that Gigi Hadid is currently rumored to be Leo DiCaprio's girlfriend.    Final Answer: Gigi Hadid is currently rumored to be Leo DiCaprio's girlfriend.        > Finished chain.    "Gigi Hadid is currently rumored to be Leo DiCaprio's girlfriend."PreviousToolsNextHuman-in-the-loop Tool ValidationCompletely New Tools - String Input and OutputTool dataclassSubclassing the BaseTool classUsing the tool decoratorCustom Structured ToolsStructuredTool dataclassSubclassing the BaseToolUsing the decoratorModify existing toolsDefining the priorities among ToolsUsing tools to return directlyHandling Tool ErrorsCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬©
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: ->: func=search_tool3.run,        name="Search_tool3",        description="useful for when you need to answer questions about current events",    ),]agent = initialize_agent(    tools,    ChatOpenAI(temperature=0),    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,    verbose=True,)agent.run("Who is Leo DiCaprio's girlfriend?")            > Entering new AgentExecutor chain...    I should use Search_tool1 to find recent news articles about Leo DiCaprio's personal life.    Action: Search_tool1    Action Input: "Leo DiCaprio girlfriend"    Observation: The search tool1 is not available.    Thought:I should try using Search_tool2 instead.    Action: Search_tool2    Action Input: "Leo DiCaprio girlfriend"    Observation: The following errors occurred during tool execution:The search tool2 is not available.Please try another tool.    Thought:I should try using Search_tool3 as a last resort.    Action: Search_tool3    Action Input: "Leo DiCaprio girlfriend"    Observation: Leonardo DiCaprio and Gigi Hadid were recently spotted at a pre-Oscars party, sparking interest once again in their rumored romance. The Revenant actor and the model first made headlines when they were spotted together at a New York Fashion Week afterparty in September 2022.    Thought:Based on the information from Search_tool3, it seems that Gigi Hadid is currently rumored to be Leo DiCaprio's girlfriend.    Final Answer: Gigi Hadid is currently rumored to be Leo DiCaprio's girlfriend.        > Finished chain.    "Gigi Hadid is currently rumored to be Leo DiCaprio's girlfriend."PreviousToolsNextHuman-in-the-loop Tool ValidationCompletely New Tools - String Input and OutputTool dataclassSubclassing the BaseTool classUsing the tool decoratorCustom Structured ToolsStructuredTool dataclassSubclassing the BaseToolUsing the decoratorModify existing toolsDefining the priorities among ToolsUsing tools to return directlyHandling Tool ErrorsCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬©