WEBVTT

00:00.280 --> 00:00.880
Hey there.

00:00.920 --> 00:01.560
Eden here.

00:01.560 --> 00:06.520
And in this video, we'll be setting up our project for our reflection agent.

00:06.840 --> 00:13.480
So we'll create the project directory, and we'll use poetry to create our virtual environment and to

00:13.520 --> 00:15.040
install our dependencies.

00:15.280 --> 00:21.480
We'll then open PyCharm and configure it to point to the virtual environment we are using.

00:22.200 --> 00:30.120
And we'll create a dot env file that will hold all of our open AI API keys and API keys, because we're

00:30.120 --> 00:32.280
going to be using Lindsmith for tracing.

00:35.520 --> 00:42.120
Let's see into desktop and create a new directory and we'll call it reflection agent.

00:43.000 --> 00:44.360
We'll CD into it.

00:48.200 --> 00:55.400
And now we want to write poetry in it to initialize our virtual environment and to start installing

00:55.400 --> 00:56.280
our packages.

00:57.680 --> 01:03.600
So I'm going to see I have a pyproject.toml and now I want to install the dependencies.

01:03.920 --> 01:09.960
We'll install Python Dotenv black eishort for formatting and environment variables.

01:10.440 --> 01:14.210
And of course we'll install link chain link chain OpenAI I.

01:14.930 --> 01:17.970
And how can we not forget landgraaf.

01:22.290 --> 01:24.330
So this would take a couple of seconds.

01:28.330 --> 01:30.730
And all of our dependencies are installed.

01:31.450 --> 01:34.810
Now I want to create a new file a dot env file.

01:35.370 --> 01:37.890
And let's now open PyCharm.

01:40.570 --> 01:42.930
And open our project.

01:43.210 --> 01:45.930
So I'm going to look for reflection agent.

01:46.690 --> 01:49.970
And I'm going to open everything in our IDE.

01:50.850 --> 01:56.250
Now notice on the bottom right that PyCharm detected our poetry virtual environment.

01:56.250 --> 02:03.290
And our project interpreter is configured to point to the environment with the packages installed.

02:03.890 --> 02:09.090
And lastly, we want to populate the dot env file with our environment variables.

02:09.090 --> 02:14.130
So we need the open ai API key because we're going to talk to GPT four turbo.

02:14.490 --> 02:19.170
We need the API key because we need a search engine to search online.

02:19.450 --> 02:26.330
And we need the API key because we're going to be leveraging Langschmidt for monitoring and tracing.

02:26.570 --> 02:30.410
So let's also set link length chain tracing v2 equals true.

02:30.730 --> 02:34.490
And we'll call the link chain project reflection agent.

02:34.490 --> 02:36.890
So that would be displayed in the UI.

02:39.050 --> 02:39.650
All right.

02:39.650 --> 02:43.250
So let's now create a new file the main file.

02:46.370 --> 02:50.330
And let's write the boilerplate code if name equals main.

02:51.570 --> 02:55.250
And we want to print hello reflection.

02:57.370 --> 02:59.970
Let's configure our PyCharm runner.

02:59.970 --> 03:07.290
So I'm going to click Edit Configurations I'm going to click the plus button I'm going to select Python.

03:07.850 --> 03:10.730
Let's change the name here to be main.

03:11.530 --> 03:15.450
And in the script I'm going to choose our Main.py file.

03:18.130 --> 03:20.890
And let's click on apply.

03:21.530 --> 03:22.290
And okay.

03:23.770 --> 03:28.850
And let's add from Dotenv import Dotenv.

03:28.890 --> 03:32.530
And let's load the environment variables and run everything.

03:32.530 --> 03:34.010
And we can see it's working.

03:34.170 --> 03:36.650
The environment variables are properly loaded.

03:37.010 --> 03:40.530
And we're ready to continue and start writing our agent.
