1
00:00:00,080 --> 00:00:02,960
Would you believe it's already day five of week four?
你相信现在已经是第四周的第五天了吗？

2
00:00:03,000 --> 00:00:06,760
Here we are completing our sidekick project.
在这里，我们正在完成我们的伙伴项目。

3
00:00:06,760 --> 00:00:07,800
I'm so happy!
我太高兴了！

4
00:00:07,800 --> 00:00:11,440
I love this project and I'm now such a fan of Landgraf.
我喜欢这个项目，现在我是 Landgraf 的粉丝。

5
00:00:11,480 --> 00:00:16,400
Over the course of the week, uh, we're going to be talking today about tools, tools and more tools
在这一周中，呃，我们今天将讨论工具、工具和更多工具

6
00:00:16,400 --> 00:00:21,240
we're going to be building in, uh, the same tool that we know and love already about searching the
我们将构建，呃，我们已经知道并喜欢的用于搜索的相同工具

7
00:00:21,240 --> 00:00:27,600
web, not navigating a browser, but doing the web search, uh, using the Serp API that we've used
web，不是在浏览器中导航，而是进行网络搜索，呃，使用我们使用过的 Serp API

8
00:00:27,600 --> 00:00:28,080
before.
前。

9
00:00:28,200 --> 00:00:30,400
We're going to send push notifications because why not?
我们将发送推送通知，为什么不呢？

10
00:00:30,440 --> 00:00:31,400
We know how to do that.
我们知道该怎么做。

11
00:00:31,400 --> 00:00:36,640
We're also going to add a tool to use the file system to be able to write files, so that we can have
我们还将添加一个工具来使用文件系统来写入文件，这样我们就可以

12
00:00:36,800 --> 00:00:43,040
our operator agent that we're building our, our coworker that we have with our sidekick be able to
我们正在建立的运营商代理、我们的同事以及我们的伙伴能够

13
00:00:43,080 --> 00:00:45,720
read and write files from the file system.
从文件系统读取和写入文件。

14
00:00:45,720 --> 00:00:49,840
We're going to have it have access to Wikipedia so that it can look things up.
我们将让它能够访问维基百科，以便它可以查找内容。

15
00:00:50,040 --> 00:00:54,000
And we're even going to give it the ability to run Python code itself.
我们甚至将赋予它自行运行 Python 代码的能力。

16
00:00:54,000 --> 00:00:56,320
Not not in a Docker container like we did before.
不像我们之前那样在 Docker 容器中。

17
00:00:56,360 --> 00:00:59,480
This time it's just going to have the ability to execute some Python.
这次它只是有能力执行一些Python。

18
00:00:59,640 --> 00:01:06,840
And so we're really giving it unfettered access to do things on our machine while we watch and while
因此，当我们观看时，我们确实让其不受限制地在我们的机器上执行操作

19
00:01:06,840 --> 00:01:07,790
we monitor.
我们监控。

20
00:01:08,350 --> 00:01:09,990
And that leads me to a big point.
这引出了一个重要的观点。

21
00:01:10,190 --> 00:01:14,870
Uh, the sidekick app that we're about to build is an experimental app.
呃，我们即将构建的 sidekick 应用程序是一个实验性应用程序。

22
00:01:14,910 --> 00:01:21,310
It's something for you to work with and to monitor and watch and use it for your own purposes.
您可以使用它、监视、观看它，并将其用于您自己的目的。

23
00:01:21,310 --> 00:01:27,390
This is this is an app for commercial purposes for you, for you to be able to get more and do more
这是一个为您提供商业用途的应用程序，让您能够获得更多、做更多事情

24
00:01:27,430 --> 00:01:29,670
with an AI agent at your side.
人工智能代理就在您身边。

25
00:01:29,830 --> 00:01:32,670
But in doing so, it doesn't have guardrails.
但这样做时，它没有护栏。

26
00:01:32,670 --> 00:01:36,310
It's something which is, uh, open to the wild.
这是一种，呃，对野外开放的东西。

27
00:01:36,310 --> 00:01:39,630
And as such, it needs to be treated with some caution.
因此，需要谨慎对待。

28
00:01:39,630 --> 00:01:41,390
And that's the first thing I want to say.
这是我想说的第一件事。

29
00:01:41,590 --> 00:01:44,230
Use sidekick at your own risk.
使用 Sidekick 的风险由您自行承担。

30
00:01:44,230 --> 00:01:49,270
If you're not comfortable with this, if you're not sure about the technologies behind it and so on,
如果您对此不满意，如果您不确定其背后的技术等等，

31
00:01:49,310 --> 00:01:53,310
then please do remove the Python Repl tool that we'll we'll add.
那么请删除我们将添加的 Python Repl 工具。

32
00:01:53,310 --> 00:01:59,910
You should remove it and even remove the online navigation tools until you're, you're comfortable with
您应该删除它，甚至删除在线导航工具，直到您感到满意为止

33
00:01:59,910 --> 00:02:00,390
what's going on.
这是怎么回事。

34
00:02:00,390 --> 00:02:01,470
And you can watch it.
你可以观看它。

35
00:02:01,470 --> 00:02:05,230
This is an agent that we are allowing to roam free.
这是我们允许自由漫游的代理。

36
00:02:05,270 --> 00:02:10,510
Now of course when it's using the browser it's using it's using chromium, the open source version of
当然，现在当它使用浏览器时，它使用的是 chromium，它的开源版本

37
00:02:10,510 --> 00:02:10,870
Chrome.
铬合金。

38
00:02:10,870 --> 00:02:16,970
And it doesn't have access to any of our cookies or any of our passwords in a password manager or something
而且它无法访问我们的任何 cookie 或密码管理器或其他东西中的任何密码

39
00:02:16,970 --> 00:02:17,450
like that.
像那样。

40
00:02:17,450 --> 00:02:22,970
So it's not able to do anything like log in or it doesn't have access to credit cards and so on.
因此它无法执行任何操作，例如登录或无法访问信用卡等。

41
00:02:22,970 --> 00:02:27,770
And the file manager is is within a certain directory, so it can't roam free on your computer.
而且文件管理器位于某个目录中，因此它无法在您的计算机上自由漫游。

42
00:02:27,810 --> 00:02:30,170
The Python wrapper is that's pretty open.
Python 包装器非常开放。

43
00:02:30,170 --> 00:02:34,770
It can run any Python it wants, which would allow it potentially to write something that could that
它可以运行任何它想要的Python，这将允许它编写一些东西

44
00:02:34,770 --> 00:02:36,810
could do uh, do some damage.
可以做，呃，造成一些伤害。

45
00:02:36,970 --> 00:02:39,210
Uh, so you could remove that if you're, if you're concerned.
呃，如果你担心的话，你可以删除它。

46
00:02:39,210 --> 00:02:41,450
But it does seem extremely unlikely.
但这似乎极不可能。

47
00:02:41,450 --> 00:02:43,450
But nonetheless you need to be comfortable with it.
但尽管如此，您仍需要对此感到满意。

48
00:02:43,450 --> 00:02:46,330
You need to do it at your own risk please.
请您自行承担风险。

49
00:02:46,890 --> 00:02:50,890
The the other thing I want to say is that the sidekick app is a starting point.
我想说的另一件事是 Sidekick 应用程序是一个起点。

50
00:02:50,930 --> 00:02:52,370
See it as a canvas.
将其视为画布。

51
00:02:52,490 --> 00:02:57,810
I've built something up with some prompts and some tools, and I've discovered that I can make it do
我已经用一些提示和一些工具构建了一些东西，并且我发现我可以做到这一点

52
00:02:57,810 --> 00:02:58,650
great things for me.
对我来说很棒的事情。

53
00:02:58,690 --> 00:03:04,810
It actually did some work for me, some real work, some commercial work that I needed to do, and it
它实际上为我做了一些工作，一些真正的工作，一些我需要做的商业工作，而且它

54
00:03:04,810 --> 00:03:08,730
did it for me and produced a report and it was something that I used.
为我做了这件事并制作了一份报告，这是我使用的东西。

55
00:03:08,730 --> 00:03:09,170
So.
所以。

56
00:03:09,170 --> 00:03:10,250
So it works.
所以它有效。

57
00:03:10,530 --> 00:03:11,490
It really works.
它确实有效。

58
00:03:11,490 --> 00:03:17,770
And it can deliver commercial benefit for you and be your own sidekick, let alone building it for other
它可以为您带来商业利益并成为您自己的助手，更不用说为其他人构建它了

59
00:03:17,770 --> 00:03:18,290
people.
人们。

60
00:03:18,610 --> 00:03:20,330
Uh, so see it that way.
呃，所以这么看吧。

61
00:03:20,440 --> 00:03:22,600
But you need to see it as this canvas.
但你需要将其视为画布。

62
00:03:22,600 --> 00:03:26,320
It's something which you need to to make suitable for yourself.
这是你需要做出适合自己的事情。

63
00:03:26,320 --> 00:03:30,240
You need to put in the sorts of tools and give it the kind of prompting you need.
您需要放入各种工具并给予它您需要的提示。

64
00:03:30,280 --> 00:03:35,120
When I use it, I find that it sometimes goes awry, and I need to improve my prompts and make various
我使用的时候发现有时候会出错，需要改进一下提示，做出各种提示

65
00:03:35,120 --> 00:03:36,960
changes to it to keep it on track.
对其进行更改以使其保持在正轨上。

66
00:03:36,960 --> 00:03:37,960
And that's what you have to do.
这就是你必须做的。

67
00:03:38,000 --> 00:03:42,320
It will require experimentation, and if you do so, it will pay dividends.
这需要进行实验，如果你这样做，就会得到回报。

68
00:03:42,320 --> 00:03:43,720
And that's my final point.
这就是我的最后一点。

69
00:03:43,720 --> 00:03:45,560
There's so much opportunity with this.
这里面有很多机会。

70
00:03:45,560 --> 00:03:47,840
This really unleashes a gigantic eye.
这确实释放了一只巨大的眼睛。

71
00:03:48,120 --> 00:03:51,400
But this is like it's like you're building your own madness.
但这就像是你在创造自己的疯狂。

72
00:03:51,400 --> 00:03:55,880
If you find if you find agents like, like madness from the Chinese startup that that was able to do
如果你发现如果你找到像这样的代理商，就像来自中国初创公司的疯狂一样，它能够做到

73
00:03:55,880 --> 00:04:02,040
things like hunt for good, rent in apartments and build websites and things, this is like your very
诸如寻找美好事物、租公寓、建立网站之类的事情，这就像你的

74
00:04:02,040 --> 00:04:07,520
own one that you are building and you are controlling and so you can make it do great things.
拥有一个你正在构建和控制的东西，这样你就可以让它做出伟大的事情。

75
00:04:07,680 --> 00:04:13,200
Um, but it requires effort put into it to and it will, it will take some investment of your time and
嗯，但这需要付出努力，而且会的，这需要你投入一些时间和

76
00:04:13,200 --> 00:04:14,400
experimentation.
实验。

77
00:04:14,400 --> 00:04:17,680
And so I see that see it that way, the good and the bad.
所以我认为人们会这样看待事情，无论好坏。

78
00:04:17,720 --> 00:04:19,160
It's a it's a canvas.
这是一个画布。

79
00:04:19,160 --> 00:04:22,240
It's not a completed product, but there's so much potential.
它不是一个完整的产品，但潜力巨大。

80
00:04:22,560 --> 00:04:23,560
Well let's get to it.
好吧，让我们开始吧。

81
00:04:23,560 --> 00:04:31,100
Here we are in uh, in Cursa, we're looking at, week four, of course, and now we're going to Python
当然，我们正在看，呃，在 Cursa，第四周，现在我们要学习 Python

82
00:04:31,100 --> 00:04:35,260
modules, which I know will please some people, but I'm not going to be typing code, but it's going
模块，我知道这会让一些人满意，但我不会输入代码，但它会

83
00:04:35,260 --> 00:04:37,660
to be looking at it but going through it carefully.
看着它，但仔细地浏览它。

84
00:04:38,180 --> 00:04:43,060
So sidekick, the application is divided into three Python modules.
所以sidekick，应用程序被分为三个Python模块。

85
00:04:43,540 --> 00:04:44,740
There are they are here.
有他们在这里。

86
00:04:44,740 --> 00:04:47,420
And I'll first give you like a drive by of them.
我首先会带你开车经过它们。

87
00:04:47,420 --> 00:04:49,540
There is sidekick tools.
有辅助工具。

88
00:04:49,540 --> 00:04:54,700
And this is the module where we define the different tools that we will use.
这是我们定义将使用的不同工具的模块。

89
00:04:54,700 --> 00:05:02,020
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
因此，它被很好地打包在一个地方，这将使我们能够访问大量工具，或者它会

90
00:05:02,020 --> 00:05:05,300
to give our agent access to a ton of tools, then sidekick.
让我们的代理能够使用大量工具，然后是助手。

91
00:05:05,780 --> 00:05:11,460
Now this is a bit of a long, a long, uh, module here, and maybe this should be broken up a bit.
现在这个模块有点长，呃，模块，也许应该分解一下。

92
00:05:11,700 --> 00:05:19,620
Um, but it contains a class sidekick, and that has the code that includes our worker, our evaluator,
嗯，但它包含一个类 sidekick，其中包含我们的工作人员、我们的评估人员的代码，

93
00:05:19,620 --> 00:05:21,140
and the building of the graph.
以及图表的构建。

94
00:05:21,140 --> 00:05:22,580
And we'll come and look through this.
我们会来看看这个。

95
00:05:22,660 --> 00:05:30,180
And then thirdly, there is App.py, and that is our Gradio app that manages the user interface side
第三，App.py，这是我们管理用户界面的 Gradio 应用程序

96
00:05:30,180 --> 00:05:30,620
of it.
它的。

97
00:05:31,020 --> 00:05:31,380
Okay.
好的。

98
00:05:31,420 --> 00:05:34,260
So with that, let's just spend a couple of minutes on each on each piece.
因此，让我们花几分钟的时间来讨论每件作品。
