Would you believe it's already day five of week four? 你相信现在已经是第四周的第五天了吗？
Here we are completing our sidekick project. 在这里，我们正在完成我们的伙伴项目。
I'm so happy! 我太高兴了！
I love this project and I'm now such a fan of Landgraf. 我喜欢这个项目，现在我是 Landgraf 的粉丝。
Over the course of the week, uh, we're going to be talking today about tools, tools and more tools 在这一周中，呃，我们今天将讨论工具、工具和更多工具
we're going to be building in, uh, the same tool that we know and love already about searching the 我们将构建，呃，我们已经知道并喜欢的用于搜索的相同工具
web, not navigating a browser, but doing the web search, uh, using the Serp API that we've used web，不是在浏览器中导航，而是进行网络搜索，呃，使用我们使用过的 Serp API
before. 前。
We're going to send push notifications because why not? 我们将发送推送通知，为什么不呢？
We know how to do that. 我们知道该怎么做。
We're also going to add a tool to use the file system to be able to write files, so that we can have 我们还将添加一个工具来使用文件系统来写入文件，这样我们就可以
our operator agent that we're building our, our coworker that we have with our sidekick be able to 我们正在建立的运营商代理、我们的同事以及我们的伙伴能够
read and write files from the file system. 从文件系统读取和写入文件。
We're going to have it have access to Wikipedia so that it can look things up. 我们将让它能够访问维基百科，以便它可以查找内容。
And we're even going to give it the ability to run Python code itself. 我们甚至将赋予它自行运行 Python 代码的能力。
Not not in a Docker container like we did before. 不像我们之前那样在 Docker 容器中。
This time it's just going to have the ability to execute some Python. 这次它只是有能力执行一些Python。
And so we're really giving it unfettered access to do things on our machine while we watch and while 因此，当我们观看时，我们确实让其不受限制地在我们的机器上执行操作
we monitor. 我们监控。
And that leads me to a big point. 这引出了一个重要的观点。
Uh, the sidekick app that we're about to build is an experimental app. 呃，我们即将构建的 sidekick 应用程序是一个实验性应用程序。
It's something for you to work with and to monitor and watch and use it for your own purposes. 您可以使用它、监视、观看它，并将其用于您自己的目的。
This is this is an app for commercial purposes for you, for you to be able to get more and do more 这是一个为您提供商业用途的应用程序，让您能够获得更多、做更多事情
with an AI agent at your side. 人工智能代理就在您身边。
But in doing so, it doesn't have guardrails. 但这样做时，它没有护栏。
It's something which is, uh, open to the wild. 这是一种，呃，对野外开放的东西。
And as such, it needs to be treated with some caution. 因此，需要谨慎对待。
And that's the first thing I want to say. 这是我想说的第一件事。
Use sidekick at your own risk. 使用 Sidekick 的风险由您自行承担。
If you're not comfortable with this, if you're not sure about the technologies behind it and so on, 如果您对此不满意，如果您不确定其背后的技术等等，
then please do remove the Python Repl tool that we'll we'll add. 那么请删除我们将添加的 Python Repl 工具。
You should remove it and even remove the online navigation tools until you're, you're comfortable with 您应该删除它，甚至删除在线导航工具，直到您感到满意为止
what's going on. 这是怎么回事。
And you can watch it. 你可以观看它。
This is an agent that we are allowing to roam free. 这是我们允许自由漫游的代理。
Now of course when it's using the browser it's using it's using chromium, the open source version of 当然，现在当它使用浏览器时，它使用的是 chromium，它的开源版本
Chrome. 铬合金。
And it doesn't have access to any of our cookies or any of our passwords in a password manager or something 而且它无法访问我们的任何 cookie 或密码管理器或其他东西中的任何密码
like that. 像那样。
So it's not able to do anything like log in or it doesn't have access to credit cards and so on. 因此它无法执行任何操作，例如登录或无法访问信用卡等。
And the file manager is is within a certain directory, so it can't roam free on your computer. 而且文件管理器位于某个目录中，因此它无法在您的计算机上自由漫游。
The Python wrapper is that's pretty open. Python 包装器非常开放。
It can run any Python it wants, which would allow it potentially to write something that could that 它可以运行任何它想要的Python，这将允许它编写一些东西
could do uh, do some damage. 可以做，呃，造成一些伤害。
Uh, so you could remove that if you're, if you're concerned. 呃，如果你担心的话，你可以删除它。
But it does seem extremely unlikely. 但这似乎极不可能。
But nonetheless you need to be comfortable with it. 但尽管如此，您仍需要对此感到满意。
You need to do it at your own risk please. 请您自行承担风险。
The the other thing I want to say is that the sidekick app is a starting point. 我想说的另一件事是 Sidekick 应用程序是一个起点。
See it as a canvas. 将其视为画布。
I've built something up with some prompts and some tools, and I've discovered that I can make it do 我已经用一些提示和一些工具构建了一些东西，并且我发现我可以做到这一点
great things for me. 对我来说很棒的事情。
It actually did some work for me, some real work, some commercial work that I needed to do, and it 它实际上为我做了一些工作，一些真正的工作，一些我需要做的商业工作，而且它
did it for me and produced a report and it was something that I used. 为我做了这件事并制作了一份报告，这是我使用的东西。
So. 所以。
So it works. 所以它有效。
It really works. 它确实有效。
And it can deliver commercial benefit for you and be your own sidekick, let alone building it for other 它可以为您带来商业利益并成为您自己的助手，更不用说为其他人构建它了
people. 人们。
Uh, so see it that way. 呃，所以这么看吧。
But you need to see it as this canvas. 但你需要将其视为画布。
It's something which you need to to make suitable for yourself. 这是你需要做出适合自己的事情。
You need to put in the sorts of tools and give it the kind of prompting you need. 您需要放入各种工具并给予它您需要的提示。
When I use it, I find that it sometimes goes awry, and I need to improve my prompts and make various 我使用的时候发现有时候会出错，需要改进一下提示，做出各种提示
changes to it to keep it on track. 对其进行更改以使其保持在正轨上。
And that's what you have to do. 这就是你必须做的。
It will require experimentation, and if you do so, it will pay dividends. 这需要进行实验，如果你这样做，就会得到回报。
And that's my final point. 这就是我的最后一点。
There's so much opportunity with this. 这里面有很多机会。
This really unleashes a gigantic eye. 这确实释放了一只巨大的眼睛。
But this is like it's like you're building your own madness. 但这就像是你在创造自己的疯狂。
If you find if you find agents like, like madness from the Chinese startup that that was able to do 如果你发现如果你找到像这样的代理商，就像来自中国初创公司的疯狂一样，它能够做到
things like hunt for good, rent in apartments and build websites and things, this is like your very 诸如寻找美好事物、租公寓、建立网站之类的事情，这就像你的
own one that you are building and you are controlling and so you can make it do great things. 拥有一个你正在构建和控制的东西，这样你就可以让它做出伟大的事情。
Um, but it requires effort put into it to and it will, it will take some investment of your time and 嗯，但这需要付出努力，而且会的，这需要你投入一些时间和
experimentation. 实验。
And so I see that see it that way, the good and the bad. 所以我认为人们会这样看待事情，无论好坏。
It's a it's a canvas. 这是一个画布。
It's not a completed product, but there's so much potential. 它不是一个完整的产品，但潜力巨大。
Well let's get to it. 好吧，让我们开始吧。
Here we are in uh, in Cursa, we're looking at, week four, of course, and now we're going to Python 当然，我们正在看，呃，在 Cursa，第四周，现在我们要学习 Python
modules, which I know will please some people, but I'm not going to be typing code, but it's going 模块，我知道这会让一些人满意，但我不会输入代码，但它会
to be looking at it but going through it carefully. 看着它，但仔细地浏览它。
So sidekick, the application is divided into three Python modules. 所以sidekick，应用程序被分为三个Python模块。
There are they are here. 有他们在这里。
And I'll first give you like a drive by of them. 我首先会带你开车经过它们。
There is sidekick tools. 有辅助工具。
And this is the module where we define the different tools that we will use. 这是我们定义将使用的不同工具的模块。
So it's nicely packaged up in one place that is going to get us access to a ton of tools, or it's going 因此，它被很好地打包在一个地方，这将使我们能够访问大量工具，或者它会
to give our agent access to a ton of tools, then sidekick. 让我们的代理能够使用大量工具，然后是助手。
Now this is a bit of a long, a long, uh, module here, and maybe this should be broken up a bit. 现在这个模块有点长，呃，模块，也许应该分解一下。
Um, but it contains a class sidekick, and that has the code that includes our worker, our evaluator, 嗯，但它包含一个类 sidekick，其中包含我们的工作人员、我们的评估人员的代码，
and the building of the graph. 以及图表的构建。
And we'll come and look through this. 我们会来看看这个。
And then thirdly, there is App.py, and that is our Gradio app that manages the user interface side 第三，App.py，这是我们管理用户界面的 Gradio 应用程序
of it. 它的。
Okay. 好的。
So with that, let's just spend a couple of minutes on each on each piece. 因此，让我们花几分钟的时间来讨论每件作品。