Please take time to understand this process very thoroughly.
React prompting is used to allow agents to deduce which tools it needs to use logically.
We will use react, which prompts the agents iteratively and requires to generate three main steps.
Let's say we want a description of how a bird chirps.
Thought is basically a logical explanation of what the model should perform.
For example, I'll use Doc Retriever tool to find description of how the bird chirps.
Then the next step is an action, a precise operation that must be executed.
So in this case we have the tool doc retrievers, which input says description of how the bird chirps,
and then the observation is the output produced by action.
That is a tool call after it has been performed.
For example, here birds chirps is a light, melodic sound that often feels chirps and rhythmic with
a sequence of short, high pitched notes.
So now we'll create the agent prompt to execute the desired react prompting.
So here is the agent prompt.
You are designed to help with a variety of multi-modal task and can perform multi hops to answer questions.
This is the thought that we have provided.
Now the next logical step is action.
So we specify here you have access to a wide variety of tools.
You are responsible for using tools in any sequence you deem appropriate to complete the task.
Break the task into subtasks and iterate to complete each subtask.
And here is where we provide the tools.
And then the last step here is the observation or the output format.
If you need to make a tool call, your response should follow the following structure.
Provide the thought.
Your reasoning process the tool that you invoked.
The tool input in the JSON format which is input.
Hello world!
We have provided how the input should look like and the observation as tool response.
And then this is what is the stop token or stop words by text criteria.
And then this is where the agent will stop creating the or generating the response based on the tool
response.
You decide whether you need another more information.
If so, make another tool call with the same structure.
And then if you have enough information without using any more tools, you must give your answer to
the question with final answer and respond in the following format.
Here is what we have given the format thought.
The reasoning.
Final answer to humans.
User question.
This is the react prompt and this is the prompt template with the system as role.
The agent prompt, which is the prompt that we provided along with the chat as user and the question
that goes to it.
Please take time to understand this very thoroughly.
It's very important to understand the entire Agentic prompt here that will guide the model or large
language model to follow certain processes.
Invoke tools and do necessary actions depending on this prompt.
Thank you.
I'll see you in the next video.