Agents – making an LLM to reason and act
In this recipe, we will learn how to make an LLM reason and act. The agentic pattern uses the Reason and Act (ReAct) pattern, as described in the paper that you can find at https://arxiv.org/abs/2210.03629. We start by creating a few tools with an LLM. These tools internally describe the action they can help with. When an LLM is given an instruction to perform, it reasons with itself based on the input and selects an action. This action maps with a tool that is part of the agent execution chain. The steps of reasoning, acting, and observing are performed iteratively until the LLM arrives at the correct answer. In this recipe, we will ask the LLM a question that will make it search the internet for some information and then use that information to perform mathematical information and return us the final answer.
Getting ready
We will use a model from OpenAI in this recipe. Please refer to Model access under the Technical requirements...