WEBVTT

00:00.080 --> 00:03.000
Please take time to understand this process very thoroughly.

00:03.280 --> 00:08.880
React prompting is used to allow agents to deduce which tools it needs to use logically.

00:09.320 --> 00:15.720
We will use react, which prompts the agents iteratively and requires to generate three main steps.

00:16.160 --> 00:19.400
Let's say we want a description of how a bird chirps.

00:19.760 --> 00:24.080
Thought is basically a logical explanation of what the model should perform.

00:24.960 --> 00:30.600
For example, I'll use Doc Retriever tool to find description of how the bird chirps.

00:31.160 --> 00:36.800
Then the next step is an action, a precise operation that must be executed.

00:37.080 --> 00:44.320
So in this case we have the tool doc retrievers, which input says description of how the bird chirps,

00:44.480 --> 00:48.040
and then the observation is the output produced by action.

00:48.360 --> 00:51.240
That is a tool call after it has been performed.

00:52.040 --> 00:58.840
For example, here birds chirps is a light, melodic sound that often feels chirps and rhythmic with

00:58.840 --> 01:01.240
a sequence of short, high pitched notes.

01:01.680 --> 01:06.360
So now we'll create the agent prompt to execute the desired react prompting.

01:06.720 --> 01:08.760
So here is the agent prompt.

01:08.920 --> 01:15.680
You are designed to help with a variety of multi-modal task and can perform multi hops to answer questions.

01:16.560 --> 01:18.920
This is the thought that we have provided.

01:19.440 --> 01:22.320
Now the next logical step is action.

01:22.520 --> 01:26.280
So we specify here you have access to a wide variety of tools.

01:26.480 --> 01:31.840
You are responsible for using tools in any sequence you deem appropriate to complete the task.

01:32.200 --> 01:37.000
Break the task into subtasks and iterate to complete each subtask.

01:37.920 --> 01:40.200
And here is where we provide the tools.

01:40.560 --> 01:44.600
And then the last step here is the observation or the output format.

01:44.880 --> 01:49.600
If you need to make a tool call, your response should follow the following structure.

01:49.960 --> 01:51.280
Provide the thought.

01:51.640 --> 01:55.360
Your reasoning process the tool that you invoked.

01:55.760 --> 01:58.800
The tool input in the JSON format which is input.

01:58.840 --> 01:59.720
Hello world!

01:59.960 --> 02:05.120
We have provided how the input should look like and the observation as tool response.

02:06.000 --> 02:11.840
And then this is what is the stop token or stop words by text criteria.

02:12.200 --> 02:18.410
And then this is where the agent will stop creating the or generating the response based on the tool

02:18.410 --> 02:19.170
response.

02:19.290 --> 02:22.330
You decide whether you need another more information.

02:22.650 --> 02:26.650
If so, make another tool call with the same structure.

02:27.530 --> 02:33.490
And then if you have enough information without using any more tools, you must give your answer to

02:33.490 --> 02:38.330
the question with final answer and respond in the following format.

02:38.890 --> 02:41.810
Here is what we have given the format thought.

02:42.170 --> 02:43.090
The reasoning.

02:43.290 --> 02:45.930
Final answer to humans.

02:45.930 --> 02:47.170
User question.

02:47.530 --> 02:52.730
This is the react prompt and this is the prompt template with the system as role.

02:52.970 --> 02:58.610
The agent prompt, which is the prompt that we provided along with the chat as user and the question

02:58.610 --> 02:59.770
that goes to it.

03:00.690 --> 03:03.690
Please take time to understand this very thoroughly.

03:04.090 --> 03:09.890
It's very important to understand the entire Agentic prompt here that will guide the model or large

03:09.890 --> 03:12.890
language model to follow certain processes.

03:13.250 --> 03:17.690
Invoke tools and do necessary actions depending on this prompt.

03:18.250 --> 03:19.050
Thank you.

03:19.090 --> 03:20.930
I'll see you in the next video.
