1
00:00:03,130 --> 00:00:03,400
Okay.

2
00:00:03,400 --> 00:00:11,170
So in this application, uh, we are going to prepare a very, very simple solution, in my opinion,

3
00:00:11,170 --> 00:00:12,910
maybe even too simple.

4
00:00:12,910 --> 00:00:21,730
But the goal of this exercise is to a communicate you a couple of important concepts.

5
00:00:21,730 --> 00:00:28,840
So what we are going to do in this application is to create a chatbot with personality and memory.

6
00:00:29,170 --> 00:00:35,920
And in order to do that, you will see that this is going to be a very, very simple process.

7
00:00:35,920 --> 00:00:43,060
If you look at the code in the right side of the screen, as always, we are, uh, using the OpenAI

8
00:00:43,060 --> 00:00:47,260
AP API key, you know, from our dot m file.

9
00:00:47,260 --> 00:00:53,350
And after that, what we are going to do is to define the personality of the chatbot.

10
00:00:53,650 --> 00:00:54,520
This is very important.

11
00:00:54,520 --> 00:00:59,230
And this is going to be part of the prompt we are going to send to ChatGPT.

12
00:00:59,530 --> 00:01:08,980
And in short, what we are doing here is telling ChatGPT what is the role we want her to adopt in this

13
00:01:08,980 --> 00:01:12,550
case is the Master Yoda from Star Wars, right?

14
00:01:12,550 --> 00:01:20,350
We we tell him, okay, you are this character and you, we want you to behave in this way.

15
00:01:20,350 --> 00:01:27,460
So you are Master Yoda or you are among your goal is to help the user to strengthen the her performance

16
00:01:27,460 --> 00:01:27,970
and speed.

17
00:01:27,970 --> 00:01:28,570
Okay.

18
00:01:28,810 --> 00:01:29,650
And.

19
00:01:30,450 --> 00:01:38,520
We are telling a target in this prompt that we are going to include a couple of things.

20
00:01:38,520 --> 00:01:43,170
One is the one is the chat history and the other is the user input.

21
00:01:43,170 --> 00:01:43,770
Right.

22
00:01:43,770 --> 00:01:52,470
So in the prompt template we are going to tell what is the main template, which is this one, and what

23
00:01:52,470 --> 00:01:56,010
are the two variables that this template has.

24
00:01:57,090 --> 00:02:04,320
And once we have that we are going to configure the memory of the chatbot using a component called conversation

25
00:02:04,320 --> 00:02:05,400
buffer memory.

26
00:02:05,400 --> 00:02:08,610
And you see that the configuration is very easy.

27
00:02:08,610 --> 00:02:19,860
And once we have that, we create an instance of the LM and a chain with LM chain that is going to include

28
00:02:19,860 --> 00:02:23,370
the LM instance, the prompt and the memory.

29
00:02:23,370 --> 00:02:24,480
This verbose true.

30
00:02:24,510 --> 00:02:25,290
Don't worry about this.

31
00:02:25,290 --> 00:02:26,670
This is not necessary.

32
00:02:27,210 --> 00:02:36,270
So once we have that ready we can start a using this chain to ask questions.

33
00:02:37,110 --> 00:02:39,630
So we can ask this this first one.

34
00:02:39,630 --> 00:02:43,260
Master Yoda, how should I have to face my day?

35
00:02:43,260 --> 00:02:46,530
And the Master Yoda is going to answer in a very proper way.

36
00:02:46,530 --> 00:02:48,960
Focus on the proper moment, blah blah blah blah blah.

37
00:02:49,080 --> 00:02:53,760
Second question how can I deal with an enemy that wants to kill me?

38
00:02:53,760 --> 00:02:56,190
And the master Yoda is going to answer again.

39
00:02:56,190 --> 00:02:59,040
The best way to deal with an enemy is to remain calm.

40
00:02:59,040 --> 00:02:59,670
La la la la.

41
00:03:00,060 --> 00:03:06,300
And here in the last question, we are going to check if the chatbot has memory.

42
00:03:06,300 --> 00:03:09,240
So do you remember what was my first question?

43
00:03:09,240 --> 00:03:13,080
And indeed he remembers your first question was blah blah.

44
00:03:13,080 --> 00:03:24,540
So in a very easy and fast way, again, in a very basic way, we have created a chatbot with personality

45
00:03:24,540 --> 00:03:25,680
and memory.

46
00:03:25,680 --> 00:03:30,330
We will see that, you know, a chatbot can have a lot of features.

47
00:03:30,330 --> 00:03:31,890
You know, and functionality.

48
00:03:31,890 --> 00:03:39,180
This is just a very, very, very elemental version of a chatbot that is important now to start learning

49
00:03:39,180 --> 00:03:40,200
about it.

