Adding Multiple Steps
The model now has the ability to call tools to get the necessary information to answer a query. However, the model doesn't answer the users question after it gets the information. Why is that?
Well, the model has techincally completed it's generation as it generated a tool call. In order to get the model to answer the user's question, we need feed the results back to the model alongside the original question. We can do this by configuring the maximum number of steps the model can take. By default maxSteps is set to 1.
Update your page.tsx
to add multiple steps to the chatbot
Head back to the browser and ask for the weather again. Notice that the model now answers the user's question after it gets the relevant information.