WEBVTT

00:00.120 --> 00:01.400
Hey there, Eden here.

00:01.400 --> 00:04.480
And in this video we're going to do all of the boilerplate setup.

00:04.480 --> 00:07.720
We're going to set up a virtual environment with poetry.

00:07.720 --> 00:09.800
We're going to install all the dependencies.

00:09.800 --> 00:14.480
We're going to fill out the env file with all the API keys that we need.

00:14.520 --> 00:19.400
And after this video we'll be ready to implement our react graph graph.

00:21.360 --> 00:23.960
So we have now an empty directory.

00:23.960 --> 00:28.160
Let's go and initialize our poetry project with poetry init.

00:28.680 --> 00:32.360
And let me go now and click enter for everything.

00:34.880 --> 00:37.000
All right so we have a poetry project.

00:37.000 --> 00:39.800
Let's go and add a new file here.

00:40.000 --> 00:40.760
Let's call it.

00:40.800 --> 00:41.640
Gitignore.

00:42.080 --> 00:46.240
And here I'm simply going to paste here a standard Python.

00:46.240 --> 00:47.280
Gitignore file.

00:47.400 --> 00:53.320
And what's important to me here is that it won't add into GitHub any env files.

00:53.320 --> 00:56.000
So I won't expose in GitHub any API keys.

00:56.400 --> 00:58.360
And you can take the content of the.

00:58.400 --> 01:05.040
Gitignore file from the repository or from the videos resources where I'm going to attach the content

01:05.040 --> 01:05.840
of this file.

01:06.640 --> 01:07.240
All right.

01:07.240 --> 01:10.800
So let's go now and install the packages that we need.

01:11.400 --> 01:13.720
Of course we want to install link chain.

01:14.000 --> 01:15.760
We want link chain OpenAI.

01:16.360 --> 01:18.880
We want link chain Tahvili for search.

01:19.200 --> 01:21.200
We want to install Lang graph.

01:21.760 --> 01:26.040
And we want to install Python env to load the environment variables.

01:26.400 --> 01:33.360
And let's also install black and eishort for some formatting that we'll do after we finish coding everything.

01:34.280 --> 01:38.240
So right now we're installing all the dependencies and all the packages that we need.

01:38.280 --> 01:41.800
And we'll be implementing everything with link graph.

01:42.200 --> 01:44.480
All right so we finished installing everything.

01:44.480 --> 01:47.000
Let's go and check our project.toml file.

01:47.000 --> 01:49.320
And we can see all of the dependencies installed.

01:49.720 --> 01:53.080
And let's go and create now a dot env file.

01:55.440 --> 02:00.560
And let me paste in all the environment variables that we will need for this project.

02:00.760 --> 02:03.440
And don't worry about me exposing my API keys.

02:03.480 --> 02:06.230
I revoked them before I published this video.

02:06.510 --> 02:08.430
Let's quickly review the content here.

02:08.790 --> 02:12.070
So we want to use the OpenAI API key.

02:12.070 --> 02:14.790
So we'll be able to create LLM calls.

02:14.790 --> 02:20.750
And to use the OpenAI Llms we want to enable link chain tracing.

02:20.750 --> 02:24.230
And for that we'll be needing to put the link chain API key.

02:24.630 --> 02:28.710
And we want to enable link chain tracing v2 equals to true.

02:29.190 --> 02:33.110
And I'll call the project react function calling.

02:33.110 --> 02:39.950
So all those values over here is to enable tracing for our graph graph and for the API calls we make

02:39.950 --> 02:40.750
to OpenAI.

02:41.270 --> 02:46.670
And lastly we also want to add API key to use the search API.

02:47.510 --> 02:48.070
Cool.

02:48.110 --> 02:50.990
Let's go now and create a new file.

02:50.990 --> 02:52.990
Let's call this file Main.py.

02:53.350 --> 02:56.470
And this is where we're going to run everything from our project.

02:57.030 --> 02:59.310
And let's write if name equals main.

02:59.310 --> 03:05.150
And let's go print something like hello react lang graph with function calling.

03:06.310 --> 03:09.190
All right, let me print this just as a sanity check.

03:09.710 --> 03:13.030
And I want now to import from dot env.

03:13.990 --> 03:18.950
I want to import load dot env and to load the environment variables.

03:19.310 --> 03:26.790
And here we simply printed the OpenAI API key just as a sanity check to see that we loaded the correct

03:26.790 --> 03:27.430
values.

03:27.670 --> 03:30.350
So let's go and let's try to run this.

03:30.750 --> 03:32.990
And we can see now the value of the API key.

03:33.150 --> 03:35.310
So this is working as expected.

03:35.510 --> 03:37.750
And we can remove this now from the code.

03:38.790 --> 03:39.590
Alrighty.

03:39.790 --> 03:43.190
So let's now go and create two files here.

03:43.190 --> 03:47.470
So I want to create a file called react.py.

03:48.030 --> 03:52.590
And this file is going to be holding our reasoning engine.

03:54.670 --> 03:57.950
And let's also create a node.py file.

03:57.950 --> 04:02.550
And this file is going to have and hold the implementation of our graph nodes.

04:02.750 --> 04:06.030
And in the following videos we're going to implement this.

04:06.660 --> 04:07.340
Great.

04:07.340 --> 04:09.820
So this is pretty much it for this video.

04:09.820 --> 04:12.580
Right now I am going to commit those changes.

04:12.580 --> 04:14.500
So you can see this available code.

04:14.500 --> 04:15.820
And you can clone it if you want.

04:15.860 --> 04:17.500
And you can have it as a reference.

04:17.900 --> 04:22.820
Let me write git add and let's see all the files that we created.

04:23.900 --> 04:30.820
So let me go now and commit those changes and we'll call it Project Setup.

04:34.540 --> 04:38.020
And let's go and push it into our repository.

04:43.460 --> 04:44.220
Alrighty.

04:44.260 --> 04:49.100
And if you want to check it out you can go to the repository.

04:49.580 --> 04:57.780
And here in the branches go and select the branch project slash react async function calling.

04:58.180 --> 05:01.460
And here you can see in go to the commit list.

05:01.460 --> 05:06.700
And you'll have this commit that you're seeing right now which has the implementation for everything

05:06.700 --> 05:08.220
we did in this video.
