WEBVTT

00:00.040 --> 00:07.680
Today, I'm going to show you how to connect OpenAI models to your AI agents in N810 in just a few minutes,

00:08.240 --> 00:10.640
so you can build your first agent.

00:11.200 --> 00:19.840
We'll cover how to generate API keys and set up credentials so you can use models like GPT four or GPT

00:20.120 --> 00:23.920
for mini voice models and embeddings.

00:23.920 --> 00:24.560
Models.

00:24.960 --> 00:28.600
First, we need to add the AI agent to our canvas.

00:29.360 --> 00:35.200
On the canvas, click the plus button and search for AI agent.

00:41.480 --> 00:45.240
Now you can choose between different types of agents.

00:47.320 --> 00:51.280
For now, let's keep it simple and stick with the truth agent.

00:55.600 --> 00:58.040
So now let's configure the AI agent.

00:59.320 --> 01:00.120
Scroll down.

01:02.000 --> 01:03.680
Click on add option.

01:06.280 --> 01:08.800
And you will see an option for the system message.

01:10.800 --> 01:14.500
So this is where you tell the agent how it should behave.

01:14.860 --> 01:19.740
For example, you can start with something simple like you are a helpful assistant.

01:27.980 --> 01:30.180
Next we need to choose our chat model.

01:31.860 --> 01:34.100
So let's click this plus button.

01:37.980 --> 01:41.500
Let's search for OpenAI chat model.

01:42.900 --> 01:44.180
So we can scroll down.

01:45.340 --> 01:46.260
It's the last one.

01:48.860 --> 01:55.580
So now we need to connect our agent to one of the OpenAI's powerful models.

01:56.020 --> 01:59.340
So to do this you will need to set up credentials.

02:00.660 --> 02:02.220
So click this little pen.

02:03.980 --> 02:08.540
As you can see we need API key to set up a connection.

02:08.940 --> 02:10.940
So head over to OpenAI.

02:11.100 --> 02:13.580
Com forward slash API.

02:17.220 --> 02:19.340
Create an account and login.

02:20.860 --> 02:26.400
When you first create an OpenAI account, you receive $5 of free credits.

02:26.440 --> 02:27.720
Valid for three months.

02:29.200 --> 02:30.600
Now click on settings.

02:34.160 --> 02:36.080
Under the usage section.

02:37.600 --> 02:42.320
You can see how many tokens you have used and how much you have left.

02:43.560 --> 02:45.840
This helps you keep track of your usage.

02:46.960 --> 02:50.880
Now navigate to API keys section on the left hand side.

02:54.880 --> 02:58.120
And click on Create New Secret key.

03:00.560 --> 03:06.800
Give it a name for example Nathan demo.

03:08.240 --> 03:13.520
Select project can be default project and hit create secret key.

03:17.480 --> 03:19.280
Now copy your API key.

03:24.560 --> 03:26.000
Go back into N810.

03:32.220 --> 03:33.620
And place it right here.

03:36.060 --> 03:36.780
Itself?

03:37.940 --> 03:38.260
Yes.

03:38.260 --> 03:38.780
That's great.

03:38.820 --> 03:40.460
Now we are successfully connected.

03:43.100 --> 03:43.740
So now.

03:47.980 --> 03:50.780
Let's add a memory.

03:52.580 --> 03:57.780
So the agent can remember previous messages thanks to this node.

04:05.300 --> 04:06.860
And finally, let's test it.

04:08.260 --> 04:09.340
So click on chat.

04:11.700 --> 04:14.220
And now you can ask agent whatever you want.

04:14.260 --> 04:15.180
For example.

04:17.500 --> 04:18.060
What's.

04:20.300 --> 04:21.140
The capital.

04:24.020 --> 04:24.980
Of Thailand.

04:35.380 --> 04:35.740
Yes.

04:35.740 --> 04:36.380
That's it.

04:37.260 --> 04:42.420
You only need to go through this process once, as your credentials will be saved and used in other

04:42.420 --> 04:43.140
workflows.
