WEBVTT

00:00.240 --> 00:05.480
Alrighty, so now it's time to test our graph and let's invoke it with an input.

00:05.680 --> 00:08.720
And in the input I wrote make this tweet better.

00:08.720 --> 00:15.280
And then I plugged in a tweet I wrote a while ago about Link Chains new feature tool calling, which

00:15.280 --> 00:18.640
provide us with a single interface for function calling.

00:18.720 --> 00:23.840
So that was pretty big because up until then, then only OpenAI function was supported.

00:24.080 --> 00:29.760
But now with this single interface, we can use Gemini, we can use entropy cloud, and we can use any

00:29.760 --> 00:32.280
model that supports function calling.

00:32.280 --> 00:36.640
So let's try and see what the graph says about this tweet.

00:38.720 --> 00:43.720
We'll run graph dot invoke and we'll give it the inputs.

00:44.240 --> 00:45.720
And let's run it.

00:46.760 --> 00:48.560
Now the graph is executing.

00:48.560 --> 00:54.840
If we'll go to link and we'll go to our reflection agent project, we can see we have a trace which

00:54.840 --> 00:55.680
is still running.

00:56.120 --> 01:02.280
And let's wait until it finishes and let's go and open this trace.

01:03.620 --> 01:07.700
And first of all, let's notice that it took almost 20s to run.

01:07.700 --> 01:11.740
And this makes sense because we made tons of API calls to the LLM.

01:12.180 --> 01:20.140
And if we go to the final prompt to the LLM, then we can see that the output that we got is the final

01:20.180 --> 01:22.300
tweet after all the reflection.

01:22.700 --> 01:30.620
Now, I'm definitely not a copyright expert, but what I want to show you is the process and what the

01:30.620 --> 01:33.220
LLM did to get to this output.

01:34.460 --> 01:40.180
So it would be easier to see the final prompt to the LLM, because it has already all the history and

01:40.180 --> 01:43.980
all the interaction of the agent with the LLM.

01:44.260 --> 01:49.780
So we can see we first started with a system message that you are taking, influencer tasked with writing

01:49.780 --> 01:51.740
excellent Twitter posts, blah blah, blah.

01:52.260 --> 01:54.980
And then I wrote make this tweet better.

01:55.260 --> 01:58.820
And then we started the graph iteration.

01:59.060 --> 02:06.510
And the first thing is to generate a revision for this tweet with the generate general note that we

02:06.510 --> 02:06.870
did.

02:07.230 --> 02:13.590
We didn't finish our iterations, so we went into the reflection mode and we can see the response we

02:13.830 --> 02:21.790
got back from the LM, which is artificially tagged here as human, is giving us feedback about this

02:21.790 --> 02:22.310
tweet.

02:23.030 --> 02:28.830
So after we finish this node, then we need to go back to the generate node.

02:28.830 --> 02:35.950
We generate another tweet according to this feedback and so on and so on until we go and until we have

02:35.950 --> 02:39.750
the final output which is this one.

02:40.750 --> 02:47.670
And you can see on the left side length chain even have traceability and observability for lane graph

02:47.710 --> 02:48.390
objects.

02:48.550 --> 02:50.310
So we have the should continue.

02:50.350 --> 02:51.870
We have the reflection nodes.

02:51.870 --> 02:56.670
And we have all of our graph objects built in into our trace.

02:57.110 --> 02:57.590
Cool.

02:57.750 --> 03:04.750
So we implemented a very slim version of a critiquing algorithm using graph.

03:04.790 --> 03:08.950
Now we could have done it with link chain, but look how simple it was with graph.
