Okay.
And next I want to save this because we're going to go build a new one.
And to save it you can either just press this red save button here on a PC.
It's control S on a mac, it's command S done.
And then that goes to saved.
And now I'm going to go and click on on personal.
Or I can click on overview and come back here to this screen.
It's time for us to create a new workflow okay.
Create workflow.
The red button up here we're going to add a first step.
It's going to be as before on Chatmessage.
Or I will do different things sooner or later.
And then we will give ourselves another AI agent.
You're getting to be a pro at this.
You don't need me to tell you we're going to have simple memory.
And, uh, there we go.
And chat model will use OpenAI again.
OpenAI chat model all set up.
That's all great.
We'll test it with a.
Hi there.
And hopefully everything is perfect okay.
Time for a new tool.
All right I'm going to press the plus button here.
And I'm going to type email and we are going to go to the email type Gmail, consume the Gmail API.
And now I come here and I say create new credentials.
And we're back to this sign in with Google button.
Let's give it a try.
And I press this button.
Up it comes.
It's popped up with this box again I'm going to connect it to my business email.
It could also be to my um, my my Gmail itself.
I'm going to give it access to everything.
And I'm going to say continue.
If you're not comfortable with that, then obviously give it whatever you would like.
But we're going to be always in control of what we do, and we're going to be careful with this.
Um, okay.
So we've done that.
We've connected it.
We press X, now we get to choose what tools we want to give our model access to.
And you should only pick the tools that you are comfortable giving the access to.
Of course, in later weeks we will talk more about security of AI agents.
We'll talk about something called the Lethal Trifecta.
Um, that the simplest way to make sure that you're that you're happy with what we're doing is only
ever give your model access to a tool that you are comfortable for it to use, and that's what we'll
do now.
Okay, so it's time to set up our tool to access our Gmail.
So the resource we want to look at is going to be messages.
We want it to look at emails in our email operation.
We don't want it to send emails.
We just want it to get emails.
I'm going to choose get many uh, and uh, we are going to then come down here and say we want to apply
a filter.
I've got a lot of emails in my inbox.
I don't want it to read all of them.
I want it to read anything that was received after yesterday, received in the last day.
So I do received after.
And now I can select a date and time and I can select yesterday.
Uh, but doing that would be kind of laborious because I'd be hard coding in this platform.
Yesterday's date set there, and that's kind of ugly.
So I don't want to fixed thing here I want an expression, and you'll often see fields where you can
flip between fixed and expression.
And I'm going to click on expression.
I could also click here to let the model pick a date.
But I'm going to have an expression.
And what I'm going to do is I'm now going to to put in here some code.
This this is a low code course, not a no code course.
So just occasionally you're going to see fragments of code, which for the engineers here is going to
be a cinch for some of you will be stuff to to pick up as we go.
And it's something where, you know, you'll, you'll basically get used to sort of copying things and
getting a handle for what's going on.
This is using it's so when we have code, it is mostly JavaScript code you'll be looking at.
Sometimes it can use Python, but we'll be we'll be using JavaScript.
And particularly when you see two curly braces like that, it means whatever's going in here is going
to be JavaScript.
And that's what that is.
And it's something that handles dates and times using a JavaScript library called Luxon, which is one
that is sort of built into NH n and was particularly easy way to handle dates and times.
And I mean, you know, you can just read this and it looks pretty much like English.
It's going to take now and it's going to minus one day, just as it appears to say.
And below it tells you the result of running that which is in fact a day before right now.
So and it even tells us a tip anything here is JavaScript.
So that's what I've done.
I have I have said now that I want this operation to get many messages from my Gmail account received
after a day from now.
Okay, so this is all pretty clear.
I think we will now go back to this screen.
Here we have our AI agent.
It's got its OpenAI model.
It's got simple memory and it's got this new mail tool.
I also want to mention at this point there's this this button over here called Tidy Up.
Very convenient.
If I press this, it just reshuffles everything.
It also resizes nicely to that's a nice little button to know about.
Okay.
And here we have an empty chat.
First up, let's, uh, let's get an email.
So here is my email program.
I'm going to send an email to myself, from myself, from a different email account, from my Gmail.
I'm going to say, I have exciting news.
My agent in NHSN is able to read my email.
This is huge.
So many possibilities and I'm going to send that email.
So I have I have sent that, uh, I will wait a couple of seconds for that to send, uh, going over
the ether.
And now now I'm going to say, uh, please read the most recent email that I received and summarize
and summarize the, the the summarize what it contains.
There we go.
Are we ready?
Off we go.
We give it a run.
It goes.
It's connecting to Gmail.
It's now using that tool.
It's having a think.
The most recent email you received is from Edward Donner with the subject Important News.
The content snippet indicates it shares exciting news that his agent can now read his email, which
he describes as huge with many possibilities.
This capability opens up.
Aha!
So there you have it.
There you see, it did in fact, work.
Uh, we were able to read the email that I just sent.
Our agent was able to do it.
That's pretty cool.
Uh, you can see now that we were able, with just a few clicks to get an agent, uh, reading emails.
And as you saw, we could add more tools to be able to read them and also write them as well.
Okay.
And now I'm going to come up with, uh, another tool.
I'd encourage you, by the way, to check the results of this tool and you'll see your recent emails
appearing there.
But we're going to come in here and we're going to create a new tool, another Gmail tool.
This time I want it to be able to sort of send an email, but but not I want to be more careful than
that.
I don't want to give my lamb.
Access to tools that I'm not completely comfortable.
So what I'm going to do is I'm going to have it be able to create a draft resources.
Draft operation is create.
It can choose the subject and it will be a text email.
It can choose the message, but I'm only going to allow it to be sent or to have in the two email will
have to be to my other my gmail email address.
I don't want it to be able, even though it's only a draft.
I'm going to really constrain it because I want to be in total control of this.
So that's what I've got.
Uh, you could press that button if you wanted it to decide who the email was going to itself.
Um, so there we go.
That is what we're going to do.
I'm going to now come back to here, and now I'm going to to ask my next question to my agent, okay.
And I'm going to say, please draft an email that, uh, says that, uh, I very much Agree with this
sentiment.
This is huge news.
All right.
And so we're asking our agents to do that.
And it's going to create a draft in Gmail.
And it says the workflow has been successfully completed.
Now I'm going to go and check.
And I've come back into my email program.
And sure enough right here, there is indeed a draft email that is coming from me to me that says,
Hi Edward.
I call myself by my my, my formal name, like my my parents call me.
Uh, I very much agree with your sentiment.
This is huge news.
The possibilities ahead are truly exciting with that little dead giveaway of the long m dash as the
the hint that this was a GPT generated.
Best regards editor.
I'm very formal with myself.
Uh, but there you have it.
Super simple.
We got our agent to read an email and then to draft a response to it.
It was all perfectly straightforward.
Let's tidy this up.
There we go.
It was all perfectly straightforward.
And of course we could have gone further.
We could have had it create a new email and respond to it and save it and submit it.
But we chose to be to have more constraints, to only give our agent access to the tools that we were
comfortable with.
In my case, only drafting an email and only drafting an email where the recipient was my own Gmail
account.
So I was very careful with this.
And that's a good, good practice until you're comfortable that you have the right checks and balances
in place, only equip your agent with tools that you are comfortable with it using.
And so we have we have read email and we have drafted a response.
And you can imagine, as I said to myself, the the possibilities are huge.
There is so much that you could do with that.
And of course in due course we will be doing so much.
But baby steps, that's good enough for now.
Let's let's go to the wrap.
And there we have it.
That completes day three of week one.
We have done our first few integrations and they were juicy ones.
We integrated well, you know, I say we integrated with docs, we integrated with Google Sheets, but
I'm using docs in the more general sense of the Google Drive.
So so we've done that integration and we integrated with email and you should be experimenting.
The whole purpose of this is not just to listen to what I have to say, but to do it yourself.
It's the best way to learn, the best way to build expertise, build a few workflows, look at the nodes,
look at the actual tool uses and see what got passed in and what came out, and experiment with a few
workflows.
And tomorrow we're going to get more into integrations.
We're going to do more.
We're going to keep looking at the JSON and the table, and we're going to get more and more comfortable
with integrating with stuff and with data.
And with that.
That concludes week one.
Day three.
Can you believe it 20% of the way through already?
Maybe you can, because already we've got a lot.
We've been doing lots of stuff.
We've built what could basically be an automated business process already.
Well, it just gets better and better.
I'll see you tomorrow.