Well, this is a bittersweet moment for sure. 嗯，这肯定是一个苦乐参半的时刻。
It is the final day of our journey with crew. 这是我们与船员一起旅程的最后一天。
Fifth day of week three. 第三周的第五天。
While we complete the work we've got with crew, and it's going to be a great one. 当我们与工作人员一起完成工作时，这将是一项伟大的工作。
We're going to end on a high. 我们将以高点结束。
We are going to build on the project we did last time. 我们将在上次完成的项目的基础上继续进行。
On day four, we're going to turn our coda into an engineering team. 第四天，我们将把我们的尾声变成一个工程团队。
We're going to have an engineering lead depicted here by this person chilling out because, you know, 我们将在这里描绘一位工程主管，这个人会冷静下来，因为，你知道，
that's what what leads do. 这就是潜在客户所做的事情。
Uh, we're going to have a back end engineer. 呃，我们将有一名后端工程师。
We're going to have a front end engineer, and we're going to have a test engineer seen here as someone 我们将有一名前端工程师，我们将有一名测试工程师，这里被视为某人
that's jumping on top, trying to trying to destroy, trying to break everything that they are given. 那是跳到上面，试图摧毁，试图破坏他们所得到的一切。
So this is going to be our team. 这将是我们的团队。
We're going to really use the crew and crew. 我们将真正使用工作人员和工作人员。
I let's get to it. 我让我们开始吧。
And welcome back to cursor. 欢迎回到光标。
Welcome to our final project for crew. 欢迎来到我们为船员准备的最终项目。
Let's bring up a terminal with control and the back tick. 让我们打开一个带有控制和反勾的终端。
Let's go into that third directory. 让我们进入第三个目录。
And now, of course, it is time to do crew. 现在，当然，是时候做船员了。
I create crew and it is engineering. 我创建了船员，这是工程。
Underscore team is the name of our project. Underscore团队是我们项目的名称。
Let's do it. 我们开始做吧。
Let's choose the options that it tells us. 让我们选择它告诉我们的选项。
We want OpenAI. 我们想要 OpenAI。
We want GPT four or mini. 我们想要 GPT 4 或 mini。
And then we skip making a token. 然后我们跳过制作令牌。
And then there we have our directory structure. 然后我们就有了目录结构。
And now of course we go into engineering team. 现在我们当然要进入工程团队了。
We go into source, we go into config and we open our agents YAML file. 我们进入源代码，进入配置，然后打开代理 YAML 文件。
As usual we see the boilerplate ones there the researcher and the reporting analyst. 像往常一样，我们在研究人员和报告分析师那里看到了样板文件。
So what are we going to do. 那么我们该怎么办呢？
Well we're going to first of all delete what we have here. 好吧，我们首先要删除这里的内容。
And we're going to put in our first agent. 我们将派出第一位特工。
And our first agent is going to be an engineering lead, the engineering lead for the engineering team 我们的第一个代理将成为工程主管，工程团队的工程主管
directing the work of the engineers. 指导工程师的工作。
Let's make that plural, take the high level requirements described here and prepare a detailed design 让我们采用复数形式，采用此处描述的高级要求并准备详细的设计
for the back end developer. 对于后端开发人员。
Maybe we'll leave this singular for now. 也许我们暂时保留这个单数。
If it's just one developer, everything should be in one Python module. 如果只有一名开发人员，那么一切都应该在一个 Python 模块中。
Describe the function the method signatures in the module. 描述模块中的函数和方法签名。
The Python module must be completely self-contained and ready so that it can be tested or have a simple Python 模块必须完全独立并准备就绪，以便可以对其进行测试或具有简单的功能
UI built. 用户界面已构建。
Here are the requirements. 这是要求。
So this is going to be one of our input attributes that we can pass in. 所以这将是我们可以传入的输入属性之一。
The module should be named module name. 该模块应命名为模块名称。
And the class should be named class name. 并且类应该命名为类名。
So we are going to bring in those as well. 所以我们也将引入这些。
So we're going to have this be a little bit configurable. 所以我们要让它稍微可配置。
And the backstory you're a seasoned engineering lead with a knack for writing clear and concise designs 背景故事您是一位经验丰富的工程主管，擅长编写清晰简洁的设计
okay there we go. 好吧，我们走吧。
So so look, I'm going to put on an LM now and let's have something different to usual. 所以，听着，我现在要穿上LM，让我们来点与平常不同的东西。
I think we're going to go with Gpt4. 我想我们会选择 Gpt4。
We're going to have the big guy you. 我们将迎来你这个大人物。
I've also run this with Gpt4 on many and it runs just fine. 我也在许多设备上使用 Gpt4 运行过它，并且运行得很好。
So you can do that too if you wish. 因此，如果您愿意，您也可以这样做。
And you get, you know, you get a bit more comprehensive, extensive solutions if you use its bigger 如果您使用更大的解决方案，您会得到更全面、更广泛的解决方案
cousin GPT four. 表弟 GPT 四。
Oh okay. 哦好的。
so. 所以。
And whilst that will work, of course the full way to do it is to show this is OpenAI slash like that 虽然这会起作用，但当然，完整的方法是显示这是 OpenAI 斜线，就像这样
with the provider. 与提供商。
That is the first of our agents. 这是我们的第一个代理。
Okay. 好的。
So the next agent is going to be called a backend engineer. 所以下一个代理将被称为后端工程师。
So the backend engineer is going to be a Python engineer who can write code to achieve the design described 所以后端工程师将是一名Python工程师，他可以编写代码来实现所描述的设计
by the engineering lead. 由工程主管。
So the engineering lead will do the design will lay out the sort of foundations, and the back end engineer 因此，工程主管将进行设计，奠定基础，后端工程师
will do the coding write Python module that implements the design described by the engineering lead, 将编写Python模块的编码，以实现工程主管描述的设计，
but will also pass in the requirements again. 但也会再次传递要求。
So it's going to get the requirements along with the design and the module name and class name again. 因此它将再次获取需求以及设计以及模块名称和类名称。
And it's given a decent backstory saying that it's a Python engineer with a knack for writing clean, 它有一个不错的背景故事，说它是一位具有干净编写技巧的 Python 工程师，
efficient code. 高效的代码。
Follow the design instructions carefully. 仔细遵循设计说明。
So again, we'll use a different model. 同样，我们将使用不同的模型。
We'll mix things up, and this time I suggest we use Claude 3.7 sonnet latest. 我们会把事情混合起来，这次我建议我们使用最新的 Claude 3.7 十四行诗。
Now sometimes we get an overload error from Claude? 现在有时我们会从克劳德那里得到一个过载错误？
At least I do. 至少我是这样的。
As of now. 截至目前。
So it's a little bit less stable, but nonetheless, it's a great coding model. 所以它的稳定性有点差，但尽管如此，它是一个很棒的编码模型。
Particularly so. 尤其如此。
I think it's a good one to use in this case. 我认为在这种情况下使用它是一个很好的选择。
All right. 好的。
Let's also add a front end engineer. 我们还添加一名前端工程师。
And I say front end engineer. 我说的是前端工程师。
But it's going to be a gradio engineer a gradio expert who can write a simple front end to demonstrate 但这将是一个渐变工程师，一个渐变专家，可以编写一个简单的前端来演示
a back end writer gradio UI that demonstrates the given back end all in one file to be in the same directory 后端编写器 gradio UI，演示给定的后端全部位于一个文件中，位于同一目录中
as the back end module, giving the requirements. 作为后端模块，给出需求。
Giving the back story. 给出背景故事。
A seasoned engineer highly skilled at writing simple gradio UIs for a back end class. 一位经验丰富的工程师，非常擅长为后端类编写简单的渐变 UI。
So there we have it. 所以我们就有了。
We, uh, explained that the UI needs to be in one module, and we'll use again Claude for this too. 我们，呃，解释说 UI 需要位于一个模块中，我们也将再次使用 Claude 来实现这一点。
Okay. 好的。
And one more agent. 还有一名经纪人。
Our final agent is going to be a test engineer, but I'm slightly abusing the word there. 我们的最终代理将是一名测试工程师，但我稍微滥用了这个词。
It's not. 它不是。
It's not like a QA engineer. 它不像 QA 工程师。
This is going to be a Python coder who knows how to write unit tests for a given backend module, because 这将是一个知道如何为给定后端模块编写单元测试的 Python 编码员，因为
I want to see unit tests being built out here. 我希望看到在这里构建单元测试。
So that's what the test engineer is going to do. 这就是测试工程师要做的事情。
They're going to create a test which is going to be called test underscore. 他们将创建一个称为测试下划线的测试。
And the name of the module which will be the backend module. 以及将成为后端模块的模块的名称。
And they're a seasoned QA engineer and software developer who writes great unit tests for Python. 他们是经验丰富的 QA 工程师和软件开发人员，为 Python 编写了出色的单元测试。
Code is the backstory. 代码是背景故事。
And you know, for for all of the coding part, we'll use anthropic. 你知道，对于所有编码部分，我们将使用人类。
Maybe we should shake it up. 也许我们应该改变它。
Why don't we? 我们为什么不呢？
Why don't we take a risk? 我们为什么不冒险一下呢？
We'll use deep seek instead. 我们将使用深度搜索来代替。
Deep seek. 深寻。
I'm just going to stick with deep seek chat because deep seek chat is has is also able to write terrific 我只会坚持使用深度搜索聊天，因为深度搜索聊天也能够写出很棒的文章
code as well. 代码也是如此。
So we'll we'll stick with that model and that will be our test engineer. 因此，我们将坚持使用该模型，这将是我们的测试工程师。
Now it's time for us to go on to the tasks. 现在是我们继续执行任务的时候了。
So look it's a bit repetitive. 所以看起来有点重复。
We're going to let me get rid of the gunk. 我们会让我摆脱那些黏糊糊的东西。
We're going to have a task for each agent. 我们将为每个代理分配一项任务。
And it's funny. 这很有趣。
This is one of those times when it feels like OpenAI's agents SDK is sort of more straightforward that 这是感觉 OpenAI 的代理 SDK 更简单的时候之一
they don't have this extra indirection, this idea of a task being a separate first class object, because 他们没有这种额外的间接性，即任务是一个单独的第一类对象的想法，因为
there's a lot of times that you will have this 1 to 1 mapping between a task and an agent. 很多时候，任务和代理之间会存在这种一对一的映射。
Obviously, crew has built this up because they really want you to think in terms of situations where 显然，工作人员建立了这个，因为他们真的希望你考虑以下情况：
you will have series of tasks that will be given to the same agent. 您将有一系列任务被分配给同一个代理。
And we did see that and at least one of our examples. 我们确实看到了这一点，并且至少看到了我们的一个例子。
But in this case, we are again going to have the case that there's going to be a task for each of our 但在这种情况下，我们将再次遇到这样的情况：我们的每个人都会有一个任务
agents, and it gives us an opportunity to spell out very clearly what's required. 代理，它使我们有机会非常清楚地阐明需要什么。
So the description of the task is to take the high level requirements described and prepare a detailed 所以任务的描述就是要把描述的高层次需求准备好一份详细的
design for the engineer. 为工程师设计。
This is the design task that, of course, is going to be assigned to our engineering lead. 当然，这是将分配给我们的工程主管的设计任务。
And the output is a detailed design for the engineer. 输出的是工程师的详细设计。
You'll notice that I make it important that it should only output the design in markdown format. 您会注意到，我强调它应该只以 Markdown 格式输出设计。
Otherwise it just wants to start writing the code, which is not exactly what we want. 否则它只是想开始编写代码，这并不是我们想要的。
And here we specify the the output as the module name underscore design. 而这里我们指定输出为模块名下划线设计。
And it's worth noting that you can have these templated tags in the output file name as well. 值得注意的是，您也可以在输出文件名中包含这些模板化标签。
You can have it anywhere in this YAML, and it will get substituted in for the actual name of the the 您可以将其放在此 YAML 中的任何位置，并且它将替换为实际名称
module that we're building here. 我们在这里构建的模块。
So that is the design task. 这就是设计任务。
My next one cursor wants it to be called coding task. 我的下一个光标希望将其称为编码任务。
But when I wrote it I wrote code task. 但我写的时候写的是代码任务。
There we go. 我们开始吧。
Uh, I'd like to be unpredictable. 呃，我想变得不可预测。
Uh, so the description is write a Python module that implements the design as described by the engineering 呃，所以描述是编写一个Python模块来实现工程描述的设计
lead in order to achieve the requirements. 从而达到要求的领先地位。
And then here I'm saying important output only the Python code without any markdown formatting or code 然后在这里我说重要的是仅输出Python代码，没有任何markdown格式或代码
block delimiters or backticks. 块分隔符或反引号。
And that's important because these models love to output markdown. 这很重要，因为这些模型喜欢输出降价。
And if you don't put that note in there, it's going to put that tick, tick, tick python at the top 如果你不把那个注释放在那里，它就会把那个勾号，勾号，勾号 python 放在顶部
of the file, which means it won't be a valid Python file. 文件的名称，这意味着它不是有效的 Python 文件。
And it just loves doing that. 它就是喜欢这样做。
So unless you really highlight this is important, it's going to do it. 因此，除非你真的强调这很重要，否则它就会做到这一点。
And so that is the task. 这就是任务。
And we're saying context design task, which you remember is going to make sure that that information 我们说的是上下文设计任务，你记得它会确保该信息
is made available to it. 可供其使用。
And generally speaking you can think of the tasks as being the user prompts and the agents as defining 一般来说，您可以将任务视为用户提示，将代理视为定义
the system prompts, and that that's kind of how it all comes together. 系统提示，这就是一切的组合方式。
And this context is showing us what kind of information is going to be included in that prompt from 这个上下文向我们展示了什么样的信息将包含在来自
others. 其他的。
Okay. 好的。
So that is the code task. 这就是代码任务。
How about the front end task. 前端任务怎么样。
So this is where the plot thickens. 所以这就是情节变得复杂的地方。
The front end has got to write a Gradio UI in a module App.py that demonstrates the given back end class. 前端必须在模块 App.py 中编写一个 Gradio UI，以演示给定的后端类。
Assume there's only one user and keep the UI very simple indeed. 假设只有一个用户，并保持 UI 确实非常简单。
Just a prototype or demo. 只是原型或演示。
Here are the requirements. 这是要求。
And so yeah, we keep it. 所以，是的，我们保留它。
Keep it nice and simple. 保持美观和简单。
Maybe I'm going to take out the very simple indeed. 也许我会剔除那些确实非常简单的东西。
Let's just say keep the UI simple and keep the UI clean. 我们只是说保持 UI 简单并保持 UI 干净。
Let's leave it at that. 我们就这样吧。
So, um, important. 所以，嗯，它们很重要。
Only output the raw Python code again. 只再次输出原始Python代码。
The agent is the front end engineer agent, obviously. 显然，该代理是前端工程师代理。
And of course, for its context, it needs to get the output from the code task because it's going to 当然，对于它的上下文，它需要从代码任务中获取输出，因为它将
write a user interface, which is going to directly use what the code task has written. 编写一个用户界面，它将直接使用代码任务编写的内容。
So that's going to be very interesting to see how how it's able to keep that context so well that it's 因此，看看它如何能够很好地保持这种背景，这将是非常有趣的
actually able to do this. 实际上能够做到这一点。
And then cursor is correct that the last one is indeed called test task, but it's got a little bit 然后光标是正确的，最后一个确实称为测试任务，但它有一点
more detail than cursor was suggesting. 比光标建议的更详细。
Write unit tests for the given back end module and create a test in the same directory. 为给定的后端模块编写单元测试并在同一目录中创建测试。
And this is. 这是。
Got more information one more time about outputting raw Python without clever tags. 再次获得有关在没有巧妙标签的情况下输出原始 Python 的更多信息。
And of course it also depends on the code task. 当然这也取决于代码任务。
The unit tests are not going to test the user interface, it's going to test the code. 单元测试不会测试用户界面，而是测试代码。
And that will be the output file. 这将是输出文件。
And that is it for our tasks our 1 to 1 again between the task and the agent. 这就是我们任务和代理之间的 1 对 1 关系。