WEBVTT

00:00.080 --> 00:05.800
And you hardly need me to remind you that there are those two different integration patterns for connecting

00:05.840 --> 00:07.480
11 labs with N10.

00:07.640 --> 00:13.960
The first one is when N8 ends the bus and it calls out to 11 labs, the API, just to do the text to

00:14.000 --> 00:15.680
speech and the speech to text.

00:15.880 --> 00:19.160
And that is, uh, the other way round.

00:19.160 --> 00:21.800
We start with the speech to text, and then later we do the text to speech.

00:22.080 --> 00:24.000
But that's not the best way to do it.

00:24.000 --> 00:30.920
The best way to do it is to let 11 labs be the boss, let it manage the voice agent itself, and let

00:30.920 --> 00:33.080
it treat n810 like it's a tool.

00:33.120 --> 00:39.320
The whole of the NGN flow is a tool, and the way that you treat N810 as a tool is by having a webhook.

00:39.320 --> 00:43.880
And you're going to call out to that webhook from 11 labs, it's going to have a tool, the tool and

00:43.880 --> 00:48.800
11 labs calls into ten, which has a webhook, followed by the workflow.

00:49.200 --> 00:54.400
That is the strategy that's it's actually quite easy to set it up, but conceptually it's harder to

00:54.440 --> 00:55.920
figure out exactly what's going on.

00:55.920 --> 01:01.040
All of these, these sets of tools, a tool that calls a tool, uh, that, uh, that you have to hang

01:01.080 --> 01:02.000
it together in your mind.

01:02.000 --> 01:08.780
But when you do, it makes total sense, and it's clear how that's able to be a much lower latency solution,

01:08.780 --> 01:15.260
because 11 labs gets to handle the speech conversion while it's running its tool, and so on.

01:15.380 --> 01:16.620
So that's what we're going to do.

01:16.660 --> 01:21.740
What we've set up in N810 is the going to be like our business logic.

01:21.780 --> 01:26.020
Our back end flow that's going to be triggered by a webhook.

01:26.140 --> 01:29.660
And that webhook is going to be called by 11 labs in a tool.

01:29.700 --> 01:33.460
I wouldn't be doing my job if I didn't show you one more time.

01:33.700 --> 01:35.700
The deeper terminology on APIs.

01:35.700 --> 01:36.620
If you don't kill me.

01:36.660 --> 01:38.060
I said we'd review it often.

01:38.060 --> 01:45.220
So calling API is when we talk about the web, it's what we mean when we make a web request using HTTP,

01:45.660 --> 01:47.780
we call the URL an endpoint.

01:47.780 --> 01:53.020
And you'd say stuff like I'm calling API by making an HTTP request to an endpoint.

01:53.180 --> 01:56.380
That's that's how we're connecting from an end to super base.

01:56.420 --> 01:58.300
We're calling endpoints.

01:58.620 --> 02:03.660
And if you're on the receiving end of it, the way to think of it in reverse, you could think of it

02:03.660 --> 02:09.150
like a reverse API is if you make available a webhook and say, hey, you can call this webhook, like

02:09.190 --> 02:16.270
call this API to alert me about something as like a trigger to kick me off and like I've got you've

02:16.270 --> 02:22.070
had an email notify your your your flow, your workflow that an email arrived, a document was dropped

02:22.070 --> 02:23.110
in the Google Drive.

02:23.230 --> 02:28.350
All those things might call webhooks and you might say, hey, I've set up a webhook.

02:28.390 --> 02:35.190
Please do a web request there to tell me about something happening, or I want to tell you when something

02:35.190 --> 02:35.510
happens.

02:35.510 --> 02:36.750
Please tell me your webhook.

02:37.190 --> 02:40.750
Those are examples of how you might use that in a sentence.

02:41.070 --> 02:45.830
And then there are different flavors of HTTP requests.

02:45.870 --> 02:47.670
It's known as the method.

02:47.830 --> 02:48.910
You probably remember.

02:48.910 --> 02:50.030
You saw a bunch of them.

02:50.030 --> 02:57.230
The most popular ones are get and post is usually used in APIs to fetch information.

02:57.430 --> 03:00.430
Uh, get is what's used in the internet just to collect a web page as well.

03:00.470 --> 03:06.590
But get in this context is used to to to pull information about something, usually in the form of JSON.

03:06.830 --> 03:10.370
And post is when you you send information.

03:10.410 --> 03:15.610
It was originally in the internet, used when you submit a form that does a post, and a post is used

03:15.610 --> 03:18.930
in this, this API world to send information.

03:18.930 --> 03:23.890
And in the body of this you include JSON to describe what you're sending.

03:23.890 --> 03:29.250
So there's something called the body associated with an HTTP post that contains the JSON being sent.

03:29.410 --> 03:33.730
And whilst you don't need to know all the technical details of how this works, it's just good to have

03:33.730 --> 03:40.370
the gist of it to understand the basic terminology and constructs, so that when we select post from

03:40.370 --> 03:43.130
that drop down, you have some sense of why we're doing it.

03:43.170 --> 03:47.050
Okay, so here we are back with our workflow.

03:47.090 --> 03:49.450
We've set up our question answer.

03:49.570 --> 03:56.690
Maybe we should rename this as well Agentic because nice definitive name.

03:56.690 --> 03:57.570
Here it is.

03:57.610 --> 03:59.730
We deleted the chat thing.

03:59.770 --> 04:00.330
What's missing.

04:00.330 --> 04:01.210
What we need to add.

04:01.250 --> 04:04.810
Of course, like you said out loud, did you say it out loud?

04:05.090 --> 04:05.490
Uh.

04:05.490 --> 04:06.410
Is, uh.

04:06.450 --> 04:07.690
Yes the webhook?

04:07.730 --> 04:08.130
Yes.

04:08.130 --> 04:08.650
Yes yes.

04:08.690 --> 04:09.450
Webhook.

04:10.130 --> 04:10.450
Um.

04:10.490 --> 04:10.930
Oops.

04:11.070 --> 04:11.750
Web hook.

04:11.910 --> 04:12.430
There we go.

04:12.470 --> 04:14.790
We want a web hook like so.

04:15.230 --> 04:19.590
Uh, and as before, you remember, it gives us the URL.

04:19.630 --> 04:25.390
This is Nan publishing a webhook, a URL we can use to trigger this.

04:25.590 --> 04:29.990
And I, we're going to pick post because it's sending in information.

04:29.990 --> 04:33.390
You can see the other ones there that uh you don't need to know about them.

04:33.390 --> 04:36.150
But but at some point we maybe we'll use some of the others.

04:36.430 --> 04:38.750
Uh, and we don't want to respond immediately.

04:38.750 --> 04:44.910
We want to respond using a respond to webhook node that we'll put in in just a second.

04:45.310 --> 04:46.750
And let me see now.

04:46.750 --> 04:48.150
Oh, is there anything else?

04:48.150 --> 04:48.270
No.

04:48.270 --> 04:49.110
That's it for here.

04:49.270 --> 04:49.630
Uh.

04:49.670 --> 04:50.310
That's good.

04:50.310 --> 04:52.110
This is all set up nicely.

04:52.310 --> 04:53.310
Okay, back we go.

04:53.630 --> 04:54.830
Click and escape.

04:55.110 --> 04:55.870
All right.

04:55.870 --> 04:56.830
That is our webhook.

04:56.870 --> 04:58.070
Look, we just need to attach it.

04:58.110 --> 04:58.710
We should do that.

04:58.710 --> 04:59.350
There we go.

04:59.590 --> 04:59.870
Done.

04:59.870 --> 05:02.510
And it puts the word post there just to reassure us.

05:02.550 --> 05:02.990
Okay.

05:03.030 --> 05:03.630
Onwards.

05:03.670 --> 05:06.630
Now you know well enough now that that this won't work.

05:06.630 --> 05:07.430
This thing right here.

05:07.430 --> 05:10.830
Because this is going to be set up to expect this being a chat input.

05:10.870 --> 05:15.290
Look, if I double click you can see connected chat trigger node JSON chat input.

05:15.290 --> 05:16.450
That's not going to work.

05:16.850 --> 05:20.690
And you know that we have to change this to be defined below.

05:21.210 --> 05:23.770
And then we want to turn this to an expression.

05:23.770 --> 05:26.290
And we want to pull in something here that's going to work.

05:26.290 --> 05:29.850
And I don't know if you remember from what we did on day two, can you remember what I should put in

05:29.850 --> 05:34.170
here, assuming I mean, I guess you have to know how I'm going to set it up in 11 labs, but assuming

05:34.170 --> 05:37.690
I do it exactly the same way, can you remember, do you have notes?

05:37.770 --> 05:40.490
If you're taking notes, you can go and quickly look right here it is.

05:40.490 --> 05:41.850
So it's an expression of course.

05:41.850 --> 05:44.010
So that means two curlies on either side.

05:44.010 --> 05:47.770
So we want to take the JSON that's coming in JSON dot.

05:47.850 --> 05:55.170
We remember when you do an HTTP post that it contains a body and JSON body will give us the body.

05:55.490 --> 05:58.130
And we're going to put in that body a field.

05:58.130 --> 05:59.570
And I guess we're going to call it question.

05:59.570 --> 05:59.810
Again.

05:59.810 --> 06:04.090
We might as well oops I spelled it right JSON question.

06:04.090 --> 06:05.610
That's what we'll, we'll, we'll use.

06:05.650 --> 06:09.890
And of course it can't tell us a result right now because we haven't actually run this yet.

06:09.890 --> 06:10.490
So it doesn't know.

06:10.490 --> 06:11.770
But but that's what we'll do.

06:11.770 --> 06:18.380
So just keep in mind we're going to add question a field question to the body of what 11 labs submits

06:18.380 --> 06:21.660
in its post to the webhook endpoint.

06:22.300 --> 06:24.060
Say that three times in a rush.

06:24.300 --> 06:25.020
All right.

06:25.500 --> 06:27.100
Okay, back we go.

06:27.140 --> 06:30.980
We've now set up the webhook and the agent to expect the data coming in.

06:30.980 --> 06:31.660
What's left to do?

06:31.700 --> 06:32.540
One thing left to do.

06:32.580 --> 06:33.660
Yes, there's one thing left to do.

06:33.700 --> 06:38.860
We need to add over here, type webhook again and find the respond to webhook.

06:39.420 --> 06:40.060
Okay.

06:40.100 --> 06:41.860
And you can just leave it at the defaults here.

06:41.860 --> 06:45.180
It's going to respond with what comes out of that agent.

06:45.220 --> 06:47.620
What comes out is some JSON with output in it.

06:47.620 --> 06:48.780
And then the response.

06:48.780 --> 06:50.140
And that's going to be just fine.

06:50.140 --> 06:52.820
That will work great for what goes back to our agent.

06:52.820 --> 06:53.980
It will handle that.

06:54.020 --> 06:55.580
This this should all be good.

06:55.580 --> 06:56.860
This is a genetic rag.

06:56.900 --> 06:59.260
Press the save button if you haven't already.

06:59.260 --> 07:02.940
You should always do Ctrl s command S you should do that regularly.

07:03.180 --> 07:04.700
We have set this up.

07:04.900 --> 07:07.420
Uh, and, uh, it remains for us.

07:07.580 --> 07:10.180
Uh, well, we'll leave it a bit before we press that button.

07:10.180 --> 07:11.980
It's time for us to go to 11 labs.

07:11.980 --> 07:12.500
Remember that.

07:12.540 --> 07:13.660
It feels like an age away.

07:13.900 --> 07:15.420
Uh, two days ago, we were last there.

07:15.420 --> 07:20.220
I think we're going to go back there now and set up the voice agent part of this.
