1
00:00:00,200 --> 00:00:02,240
And welcome back to cursor.
欢迎回到光标。

2
00:00:02,240 --> 00:00:07,440
And here we are in week three the crew folder.
这是第三周的船员文件夹。

3
00:00:07,480 --> 00:00:08,280
How exciting.
多么令人兴奋啊。

4
00:00:08,320 --> 00:00:11,560
Let's open it up to see what treasures I have in store for you.
让我们打开它，看看我为你准备了哪些宝藏。

5
00:00:11,920 --> 00:00:13,760
And it's completely empty.
And it's completely empty.

6
00:00:13,800 --> 00:00:15,640
It won't be empty for you, but it's empty for me.
对你来说不会是空的，但对我来说却是空的。

7
00:00:15,640 --> 00:00:19,040
Because this is starting from nothing.
因为这是从无到有的开始。

8
00:00:19,080 --> 00:00:20,680
The way that some of you like me to do it.
The way that some of you like me to do it.

9
00:00:20,680 --> 00:00:22,320
Which is, uh, gonna happen this time.
Which is, uh, gonna happen this time.

10
00:00:22,320 --> 00:00:23,800
Because that's the way that crew works.
Because that's the way that crew works.

11
00:00:24,080 --> 00:00:31,200
So we will begin then by opening up a command line like this, a terminal and crew, which you'll remember
所以我们将首先打开一个像这样的命令行，一个终端和工作人员，你会记住的

12
00:00:31,200 --> 00:00:33,520
is control and the tick on a mac.
is control and the tick on a mac.

13
00:00:33,560 --> 00:00:36,240
That is really the control button on the bottom left.
这实际上是左下角的控制按钮。

14
00:00:36,600 --> 00:00:41,880
And, uh, then, uh, or it's the view menu and terminal if you're using menus.
而且，呃，那么，呃，或者如果您使用菜单，它就是视图菜单和终端。

15
00:00:42,120 --> 00:00:47,960
So then what I'm going to do is I'm going to first change directory to go into the third directory.
那么我要做的就是首先更改目录进入第三个目录。

16
00:00:47,960 --> 00:00:56,720
Right now we are in crew and I'm going to create a new crew project, which I do by saying crew I create
Right now we are in crew and I'm going to create a new crew project, which I do by saying crew I create

17
00:00:56,960 --> 00:00:57,640
crew.
全体人员。

18
00:00:58,080 --> 00:00:59,840
And then the name of the project.
然后是项目的名称。

19
00:00:59,840 --> 00:01:06,620
And we are going to call this project debate For reasons that will become obvious, but probably already
我们将把这个项目称为辩论 出于显而易见的原因，但可能已经

20
00:01:06,660 --> 00:01:12,580
are, and it first asks us a question, and to read the question, I'll have to make this a bit larger.
是，它首先问我们一个问题，为了阅读这个问题，我必须把它放大一点。

21
00:01:12,900 --> 00:01:18,500
Um, and this is because when you first create a project, it puts in place, as I mentioned, some
嗯，这是因为当你第一次创建一个项目时，正如我提到的，它会放置一些

22
00:01:18,500 --> 00:01:21,900
scaffolding, some sort of basic project framework.
脚手架，某种基本的项目框架。

23
00:01:21,940 --> 00:01:25,980
And in order to set that up, it wants to know which model would you like me to start with.
为了进行设置，它想知道您希望我从哪个模型开始。

24
00:01:26,020 --> 00:01:31,700
So we're not necessarily fixing this, but we can start by saying open AI and we can always change it
所以我们不一定要解决这个问题，但我们可以从开放人工智能开始，我们总是可以改变它

25
00:01:31,700 --> 00:01:32,340
later.
之后。

26
00:01:32,860 --> 00:01:38,460
Select a model to use and we can choose GPT four or mini to keep it nice and cheap.
选择要使用的型号，我们可以选择 GPT 4 或 mini，以保持美观且便宜。

27
00:01:38,900 --> 00:01:40,460
And then enter your key.
然后输入您的密钥。

28
00:01:40,500 --> 00:01:45,580
Now at this point we should definitely just press enter because we already have a dot env file.
现在，我们绝对应该按 Enter 键，因为我们已经有了一个点 env 文件。

29
00:01:45,580 --> 00:01:48,180
It's trying to build env files for us.
It's trying to build env files for us.

30
00:01:48,180 --> 00:01:49,140
We don't need that.
我们不需要那个。

31
00:01:49,420 --> 00:01:54,380
We press enter and you'll see right here that it's created a bunch of files.
我们按 Enter 键，您会在这里看到它创建了一堆文件。

32
00:01:54,660 --> 00:01:59,660
And I'm going to remove the terminal for a second so that we can take a look at it, because they have
我将暂时移除终端以便我们可以查看它，因为他们有

33
00:01:59,660 --> 00:02:02,180
appeared over on the left.
appeared over on the left.

34
00:02:02,700 --> 00:02:08,560
Now one thing to get in mind is that when when you're looking at the explorer in cursor or in VSCode,
Now one thing to get in mind is that when when you're looking at the explorer in cursor or in VSCode,

35
00:02:08,800 --> 00:02:14,520
if there's a directory like crew that only has one other directory called debate, then it shows like
如果有一个像船员这样的目录只有一个名为“辩论”的目录，那么它会显示为

36
00:02:14,520 --> 00:02:14,720
this.
这。

37
00:02:14,720 --> 00:02:18,720
It doesn't bother showing multiple files, multiple folders under it.
它不会费心显示其下的多个文件、多个文件夹。

38
00:02:18,720 --> 00:02:20,080
And that can be a little bit confusing.
这可能有点令人困惑。

39
00:02:20,080 --> 00:02:24,080
So we might go back into the terminal and just make a new directory.
因此，我们可以返回终端并创建一个新目录。

40
00:02:24,080 --> 00:02:26,720
Let's let's make a directory and call it other.
让我们创建一个目录并将其命名为 other。

41
00:02:27,360 --> 00:02:30,560
And when I do that you see what just happened.
And when I do that you see what just happened.

42
00:02:30,840 --> 00:02:35,320
Now if we come in here, you'll see that there's both debate and there's an empty folder called other,
现在，如果我们来到这里，您会看到既有辩论，又有一个名为 other 的空文件夹，

43
00:02:35,320 --> 00:02:37,840
which is going to make it a little bit easier on the eyes.
which is going to make it a little bit easier on the eyes.

44
00:02:38,400 --> 00:02:38,920
Okay.
好的。

45
00:02:39,360 --> 00:02:44,080
So now let's have a quick look at what has crew created for us.
现在让我们快速浏览一下工作人员为我们创造的内容。

46
00:02:44,400 --> 00:02:50,320
So under debate, which is the name of our crew that we're about to make a debate crew, as you've probably
因此，在辩论中，这是我们将要组建辩论队的团队的名字，正如您可能已经知道的那样

47
00:02:50,320 --> 00:02:57,320
guessed, there is a folder called knowledge and that has a file user preference, and that has some
guessed, there is a folder called knowledge and that has a file user preference, and that has some

48
00:02:57,320 --> 00:02:59,800
stuff about the person who's the the user.
stuff about the person who's the the user.

49
00:02:59,800 --> 00:03:00,960
And you can change this.
你可以改变这一点。

50
00:03:00,960 --> 00:03:05,200
This would be background information that would be given to the model if we made it use of it, which
如果我们使用它，这将是提供给模型的背景信息，其中

51
00:03:05,200 --> 00:03:05,960
we will not.
我们不会。

52
00:03:06,000 --> 00:03:11,780
So this is a sort of an example of some of the scaffolding that's created in case we need to use it.
So this is a sort of an example of some of the scaffolding that's created in case we need to use it.

53
00:03:12,340 --> 00:03:15,020
Then there is a folder called debate.
Then there is a folder called debate.

54
00:03:15,300 --> 00:03:15,500
Sorry.
对不起。

55
00:03:15,500 --> 00:03:17,220
There's a folder called source.
There's a folder called source.

56
00:03:17,220 --> 00:03:20,340
And under that folder there is a folder called debate.
在该文件夹下有一个名为“辩论”的文件夹。

57
00:03:20,340 --> 00:03:25,300
And again you're seeing it in this way in the explorer because there are no other folders other than
您再次在资源管理器中以这种方式看到它，因为除了

58
00:03:25,340 --> 00:03:26,940
debate under source.
来源下的辩论。

59
00:03:27,220 --> 00:03:28,420
So sorry to recap.
很抱歉重述一下。

60
00:03:28,660 --> 00:03:34,780
Under crew we have a folder called debate, which is the name of of the project that has a sub folder
在船员下我们有一个名为“辩论”的文件夹，这是具有子文件夹的项目的名称

61
00:03:34,780 --> 00:03:40,820
subdirectory source SLC and that has a subdirectory also with the project's name debate.
subdirectory source SLC and that has a subdirectory also with the project's name debate.

62
00:03:41,300 --> 00:03:42,980
And that is where we are right now.
And that is where we are right now.

63
00:03:43,180 --> 00:03:46,060
And this is the this is the most important directory of them all.
这是其中最重要的目录。

64
00:03:46,100 --> 00:03:49,940
This this directory named the project underneath source.
这个目录将项目命名为source。

65
00:03:49,980 --> 00:03:52,020
And that has a few things in it.
And that has a few things in it.

66
00:03:52,060 --> 00:03:54,420
It has a config directory.
它有一个配置目录。

67
00:03:54,420 --> 00:03:59,620
The config directory has two YAML files agents and tasks.
The config directory has two YAML files agents and tasks.

68
00:03:59,740 --> 00:04:00,500
And here they are.
他们就在这里。

69
00:04:00,540 --> 00:04:05,540
And they're set up with some default example code in there that we will come back and look at in just
And they're set up with some default example code in there that we will come back and look at in just

70
00:04:05,540 --> 00:04:06,260
a second.
一秒钟。

71
00:04:07,260 --> 00:04:13,160
There is a tools folder that has just, again, some scaffolding, some some, some basic stuff here
有一个工具文件夹，里面有一些脚手架，一些基本的东西

72
00:04:13,160 --> 00:04:15,720
that we might want to fill in later that we won't do this time.
我们稍后可能需要填写，但这次我们不会这样做。

73
00:04:16,280 --> 00:04:23,480
And then if we come into the root folder of debate, you'll see that there is a file, a module called
And then if we come into the root folder of debate, you'll see that there is a file, a module called

74
00:04:23,480 --> 00:04:29,160
crew dot Pi which has a bunch of scaffolding again, and then a main dot pi.
船员点 Pi 又具有一堆脚手架，然后是一个主要点 pi。

75
00:04:29,680 --> 00:04:35,160
So there we have it crew, the module, which is actually the one which brings together our crew, and
所以我们有了船员，模块，它实际上是把我们的船员聚集在一起的那个，

76
00:04:35,160 --> 00:04:38,400
it has the decorators that I mentioned to you, main.
它有我向你提到的装饰器，main。

77
00:04:38,560 --> 00:04:45,080
And then the two YAML files under config that has all been set up for us, ready for us to build our
And then the two YAML files under config that has all been set up for us, ready for us to build our

78
00:04:45,080 --> 00:04:46,080
first crew.
第一批船员。

79
00:04:46,760 --> 00:04:47,440
All right.
好的。

80
00:04:47,440 --> 00:04:54,320
So we are now going to go and define our YAML, our configuration for our agents and our tasks, starting
所以我们现在要定义我们的 YAML、我们的代理配置和我们的任务，开始

81
00:04:54,320 --> 00:04:57,600
over here with the agents YAML file.
over here with the agents YAML file.

82
00:04:58,000 --> 00:05:01,960
And this contains some default some sort of scaffolding.
这包含一些默认的某种脚手架。

83
00:05:01,960 --> 00:05:08,360
Some example agents that are called the researcher and the reporting analyst are the two examples that's
一些被称为研究员和报告分析师的示例代理是两个例子

84
00:05:08,360 --> 00:05:08,840
given.
给予。

85
00:05:08,840 --> 00:05:11,620
And we're going to change these to being what we're looking to build.
我们将把这些改变为我们想要构建的。

86
00:05:11,620 --> 00:05:14,260
And of course, we're looking to build a debate team.
当然，我们正在寻求建立一个辩论队。

87
00:05:14,420 --> 00:05:17,300
And in fact, we only need two agents for what we're looking to do.
事实上，我们只需要两名代理来完成我们想要做的事情。

88
00:05:17,300 --> 00:05:19,220
We want an agent that will be the debater.
We want an agent that will be the debater.

89
00:05:19,460 --> 00:05:24,340
Our one agent is going to play both roles of being for and against the the motion.
我们的一名代理人将扮演支持和反对该动议的角色。

90
00:05:24,660 --> 00:05:28,380
And then we will have a judge and those will be our two agents.
然后我们将有一名法官，他们将是我们的两名代理人。

91
00:05:28,380 --> 00:05:30,260
And now we need to describe what they are.
And now we need to describe what they are.

92
00:05:30,460 --> 00:05:33,420
And so the, the role is the first thing that we say here.
所以，角色是我们在这里说的第一件事。

93
00:05:33,420 --> 00:05:37,980
And we're going to say a compelling debater right there okay.
我们要说一位引人注目的辩手就在那里。

94
00:05:38,020 --> 00:05:43,380
And now the goal is what what it's it's looking to achieve the objectives.
现在的目标是它希望实现的目标是什么。

95
00:05:43,580 --> 00:05:49,540
And so let's see I'm going to actually copy across one that I did earlier.
因此，让我们看看我将实际复制我之前所做的一个。

96
00:05:49,540 --> 00:05:51,260
So you don't have to watch me typing everything.
So you don't have to watch me typing everything.

97
00:05:51,260 --> 00:05:56,020
But we're going to present a clear argument either in favor of or against the motion.
但我们将提出支持或反对该动议的明确论据。

98
00:05:56,020 --> 00:06:02,100
And the motion is and this is important, this little thing in in curly braces.
这个动作很重要，大括号里的这个小东西。

99
00:06:02,100 --> 00:06:05,780
Here is where you can effectively make this a template.
您可以在这里有效地将其设为模板。

100
00:06:05,780 --> 00:06:10,820
That is something that's going to get defined when you run this agent framework.
这是当您运行此代理框架时将被定义的内容。

101
00:06:10,820 --> 00:06:17,240
When we end up saying, Q I run, we are going to specify what we want motion to be, and we're actually
当我们最终说“Q 我跑步”时，我们将指定我们想要的运动，而我们实际上是

102
00:06:17,240 --> 00:06:19,640
going to specify that in Main.py.
将在 Main.py 中指定。

103
00:06:19,880 --> 00:06:21,120
So keep that in mind.
所以请记住这一点。

104
00:06:21,120 --> 00:06:25,600
In Main.py we're going to have to set what is motion, the motion of the debate.
在 Main.py 中，我们必须设置什么是议案，即辩论的议案。

105
00:06:25,640 --> 00:06:28,840
The thing that we're putting forward the proposal that they will debate.
我们提出的提案他们将进行辩论。

106
00:06:29,080 --> 00:06:29,560
Okay.
好的。

107
00:06:29,600 --> 00:06:37,440
And so now we have a back story, which is where we set the the it's really we know that this is the
现在我们有了一个背景故事，这就是我们设定的地方，我们真的知道这就是

108
00:06:37,440 --> 00:06:39,520
system prompt or a big part of it.
系统提示符或其很大一部分。

109
00:06:39,520 --> 00:06:46,040
But in crew land, we want to think of this as the, as the sort of framing of this, of this agent,
但在船员领域，我们希望将其视为该特工的某种框架，

110
00:06:46,040 --> 00:06:46,960
the back story.
背后的故事。

111
00:06:47,120 --> 00:06:52,320
You're an experienced debater with a knack for giving concise but convincing arguments.
您是一位经验丰富的辩手，擅长给出简洁但令人信服的论点。

112
00:06:52,320 --> 00:06:54,000
The motion is so on.
议案如此。

113
00:06:54,480 --> 00:06:58,080
So that is the definition of our agent, our debater agent.
这就是我们的代理、辩手代理的定义。

114
00:06:58,080 --> 00:07:02,800
And that will apply both for one that is presenting for an argument and against it.
这对于提出论点和反对论点的人都适用。

115
00:07:02,800 --> 00:07:06,400
And of course we'll be using tasks to distinguish between them.
当然，我们将使用任务来区分它们。

116
00:07:06,960 --> 00:07:09,320
But now let's define our judge.
But now let's define our judge.

117
00:07:09,520 --> 00:07:12,520
So we are going to give the judge a role.
So we are going to give the judge a role.

118
00:07:12,520 --> 00:07:17,060
And the role we will say is decide the winner of the debate.
我们要说的角色是决定辩论的胜利者。

119
00:07:17,060 --> 00:07:19,420
Look at how cursor even suggests what this should be.
看看光标如何建议这应该是什么。

120
00:07:19,660 --> 00:07:24,580
Let's say based on the arguments presented, let's keep it short.
让我们根据所提出的论点说，让我们保持简短。

121
00:07:25,420 --> 00:07:30,740
And then the goal I will take one that I wrote earlier because it's a couple of sentences.
然后我会采用我之前写的一个目标，因为它只有几句话。

122
00:07:30,740 --> 00:07:34,740
You can see that that amazingly cursor comes up with natural language.
您可以看到令人惊讶的光标出现了自然语言。

123
00:07:34,780 --> 00:07:36,460
It's just great for these things already.
这对于这些事情来说已经很棒了。

124
00:07:36,460 --> 00:07:40,900
So you can even define your agents just by letting cursor describe them.
因此，您甚至可以通过让光标描述代理来定义代理。

125
00:07:41,180 --> 00:07:48,660
And the backstory here I'm going to copy and paste in a nice juicy backstory, and here it is.
And the backstory here I'm going to copy and paste in a nice juicy backstory, and here it is.

126
00:07:48,820 --> 00:07:54,940
You're a fair judge with a reputation for weighing up arguments without factoring in your own views
你是一位公正的法官，以权衡争论而不考虑自己的观点而闻名

127
00:07:54,980 --> 00:07:58,100
and making a decision based purely on the merits of the argument.
并纯粹根据论点的是非曲直做出决定。

128
00:07:58,100 --> 00:07:59,220
The motion is blah.
这项议案很废话。

129
00:07:59,420 --> 00:08:03,220
So that's the sort of good way to set things like the backstory.
所以这是设置背景故事之类的好方法。

130
00:08:03,380 --> 00:08:09,340
And again, on the one hand, one way of thinking about this is that this is the kind of backstory that
再说一次，一方面，思考这个问题的一种方式是，这是一种背景故事

131
00:08:09,340 --> 00:08:14,180
an LLM is going to take into account in setting the context for this role.
法学硕士将在设置该角色的背景时考虑。

132
00:08:14,580 --> 00:08:21,320
The other, more scientific way is just to always keep in mind that what Llms are doing is predicting
另一种更科学的方法是始终牢记法学硕士正在做的是预测

133
00:08:21,320 --> 00:08:24,760
the most likely next token to follow an input.
the most likely next token to follow an input.

134
00:08:25,000 --> 00:08:31,440
And the point is that if this backstory is part of the input, then you are increasing the probability
关键是，如果这个背景故事是输入的一部分，那么你就增加了概率

135
00:08:31,440 --> 00:08:37,080
that the output tokens will be consistent with this, because things that are seen at training time
输出标记将与此一致，因为在训练时看到的东西

136
00:08:37,080 --> 00:08:43,880
that have that kind of backstory often predict tokens consistent with that backstory.
that have that kind of backstory often predict tokens consistent with that backstory.

137
00:08:43,880 --> 00:08:48,760
So that's the the more scientific way of thinking about why this tends to work really well.
因此，这是一种更科学的方式来思考为什么这种方法效果很好。

138
00:08:49,040 --> 00:08:49,680
All right.
好的。

139
00:08:49,840 --> 00:08:55,800
And then the final thing I'm going to add in here is you can also specify what model to use.
我要在此处添加的最后一件事是您还可以指定要使用的模型。

140
00:08:55,840 --> 00:08:58,600
And you can actually you can just have GPT four or mini.
实际上，您可以只使用 GPT 4 或 mini。

141
00:08:58,640 --> 00:09:06,720
Or if you want to really spell it out then you say OpenAI GPT four mini, but it assumes OpenAI by default
或者，如果您想真正拼写出来，那么您可以说 OpenAI GPT 4 mini，但默认情况下假定 OpenAI

142
00:09:06,720 --> 00:09:07,760
for that model.
对于该模型。

143
00:09:07,800 --> 00:09:08,560
What am I doing here?
我在这里做什么？

144
00:09:08,600 --> 00:09:09,600
Model colon.
模型结肠。

145
00:09:09,800 --> 00:09:10,280
There we go.
我们开始吧。

146
00:09:10,320 --> 00:09:11,920
Luckily, cursor to the rescue.
幸运的是，光标来救援。

147
00:09:12,440 --> 00:09:18,000
And this then is our YAML definition of the agents.
这就是我们对代理的 YAML 定义。

148
00:09:18,280 --> 00:09:19,680
Next up is tasks.
接下来是任务。
