Introduction to Simple React AI Agent with Azure OpenAI recipe
Introduction to Simple React AI Agent with
Azure OpenAI recipe
The Simple React AI Agent with Azure OpenAI recipe is based on REST and SOAP APIs. The
recipe shows you how to build a simple React Agent with a search tool, Google Search, using
the Serp API. The Azure OpenAI logic alternates between generating thoughts and performing
task-specific actions dynamically.
The Azure OpenAI large language model (LLM) follows a step-by-step problem-solving
approach, utilizing the search tool to gather information and perform tasks to answer
user queries. The process orchestrates the workflow based on the LLM response.
The process accepts a user query. It passes the query to the LLM with additional system
instructions to respond in a format that includes a question, thought, action, action
input, observation, final thought, and final answer.
After receiving the response from the LLM, the process checks for the presence of the
action and action input fields. If these fields are present, the process formulates a
request for the SearchTool service. Otherwise, it creates the final answer.
If the final answer isn't set, a request is sent to the SearchTool service. The process
calls the parent process with new parameters, such as user query and
Agent_Scratchpad.
The process repeats until all the actions from the initial LLM response are processed or
the number of repetitions meets the specified limit. When the process run time
approaches 60 seconds, the process provides a final response.