From the course: Build AI Agents and Chatbots with LangGraph

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Create a basic ReAct agent

Create a basic ReAct agent

- [Instructor] Let's now proceed to create the basic ReAct math agent. We will use Azure OpenAI models for the exercises in this course. First, we will set up the models. We need to set up the APA key and APA endpoint for the model hosted on Azure. Please replace these values with those specific to your account. Alternatively, you can use any of the other Langchain supported models, too, instead of Azure OpenAI. Please refer to Langchain documentation on how to create model references for other models. We will create the LLM using Azure Chat OpenAI function. We need to use the chat capabilities for requests and responses. We will use GPT-4o for the model name. The APA version is also set here. Again, you should replace them with values specific to your implementation. This can be used to test if the model has been set up correctly. For this agent, we will use the prebuilt ReAct agent in LangGraph. We import this create_react_agent class for this purpose. We will also import the…

Contents