00:00:01
hello everybody my name is Shen Yao I'm
00:00:03
a product manager at se AI uh today
00:00:06
we're going to go into some Advanced
00:00:08
tutorial of using customer GPD tools uh
00:00:11
to um perform some complex queries using
00:00:14
cchat so uh last time in my uh simple
00:00:17
tutorial I have shown you the customer
00:00:20
GPD tools over here and then we are able
00:00:22
to uh get some very very simple get a
00:00:25
dog picture or get a fox picture by
00:00:27
calling this API right dog API I over
00:00:30
here random dock um image and then um
00:00:34
random fox image over here right so uh
00:00:37
in this session I'm going to move into
00:00:38
the more advanced ones of getting
00:00:41
getting the weather right so I got a
00:00:42
free and open medial weather apepi over
00:00:46
here uh it's kind of complicated because
00:00:50
um because you have to assemble all
00:00:52
kinds of different parameters right but
00:00:54
uh let's give it a try so first let's go
00:00:57
to the documentation and then let's see
00:00:59
um
00:01:00
how to assemble this uh weather API so
00:01:03
what I'm going to do is that I'm going
00:01:04
to create a new customer GPD tool right
00:01:07
so if I go back over here you see U uh I
00:01:10
can add up to five customer GPD tools
00:01:12
over here and then enable this I will
00:01:14
say get weather uh API right so this is
00:01:19
essentially a get request and then we're
00:01:22
going to get endpoint URL and then we're
00:01:24
going to assemble all all of those
00:01:25
parameters right so how this one works
00:01:28
is this right so we have a
00:01:30
from this API
00:01:33
page uh eventually we're going to
00:01:34
assemble a final URL something
00:01:38
like something like um somewhere in this
00:01:43
uh in this place right so uh uh let's
00:01:47
see module update URL over here oh okay
00:01:50
I we actually got it over here right so
00:01:53
this is a this is the URL over here so
00:01:56
uh what we're going to do is this right
00:01:59
so I have end point URL which is all the
00:02:03
way to to up here forecast right so I'm
00:02:06
going to I'm going to change this right
00:02:09
and then we're going to say this is a
00:02:10
get weather
00:02:11
forecast uh get weather API right so the
00:02:14
description is that uh uh get weather
00:02:18
forecast of
00:02:21
forecast
00:02:23
um of a specific location right so
00:02:28
that's one and then you say okay uh from
00:02:32
here um I have a fixed latitude and a
00:02:35
longitude and then the time zone is not
00:02:38
a set up right since I'm a based in
00:02:39
Seattle so I'm going to choose America
00:02:41
Los Angeles T Zone and uh we're going to
00:02:45
do the for forecast of seven days and
00:02:48
then we're going to do the temperature
00:02:50
2m oh I don't really know what the
00:02:52
temperature 2m means um and we're going
00:02:55
to
00:02:55
say the prescription probability and
00:02:58
whether it's going to ring or not uh
00:03:00
since this is down in November and in
00:03:02
November I guess Seattle doesn't really
00:03:04
um snow that much so um let me ask a
00:03:07
Gemini first what is uh what is uh I got
00:03:11
a curious about this uh temperature 2m
00:03:14
right so uh what is 2m in uh in
00:03:17
temperature 2m over
00:03:20
here uh oh okay got it yeah so 2 2 m
00:03:24
actually means 2 m right so the
00:03:25
temperature measure the height of 2 m
00:03:27
above above the surface okay okay that's
00:03:30
clear enough right so so after we have
00:03:33
all of this and then we're going to
00:03:34
assemble uh I'm going to reload the
00:03:37
chart and this is actually the uh from
00:03:40
this location right from this location's
00:03:42
uh weather weather report over here and
00:03:45
then that's the uh that's the entire API
00:03:47
URL right so if I copy paste this and I
00:03:50
go back over here we already have the
00:03:52
Endo right so
00:03:53
um I already have this end point and
00:03:56
then we're going to assemble the rest of
00:03:57
this right latitude longitude and
00:04:00
already is seual uh so we're going to
00:04:02
walk backwards over here right from here
00:04:05
we got two pieces one is fixed value
00:04:07
parameter and then the other one is
00:04:09
dynamic variable parameter extracted by
00:04:11
the LM right so the fixed Val parameters
00:04:15
are something like uh the predefined
00:04:17
ones right so for instance we have
00:04:18
something called a time zone right so I
00:04:20
already know that U um I want
00:04:24
to I want to uh I want the the time zone
00:04:27
um specifically to Los Angeles so we're
00:04:30
going to say okay I have the query here
00:04:32
and my key here is called a time zone
00:04:35
and then I have this fixed as value it's
00:04:37
called America uh Los Angeles that's uh
00:04:40
that's uh that's one okay I'm going to
00:04:42
add another one which is um uh which is
00:04:46
this fixed parameter right so we got a
00:04:49
arly I got a a quy over here uh yes Cory
00:04:54
is on the URL parameter string and then
00:04:56
key key here is already right so we're
00:04:59
going to have already report of the
00:05:02
temperature at 2 m above the surface and
00:05:04
then I want the um precipitation
00:05:07
probability and whether it's going to
00:05:08
ring or not so those are the two fixed
00:05:10
value parameters prefilled by the user
00:05:13
and finally this is a more kind of a
00:05:15
challenging case we're going to assemble
00:05:17
the attitude latitude and longitude
00:05:20
right so so this is actually the dynamic
00:05:22
variable parameters here determined by
00:05:24
the LM so we again have this a quiry
00:05:28
piece and then we got the string here
00:05:30
and the first one is uh latitude right
00:05:33
so I'm going to save the latitude and um
00:05:38
the default value is just a 522 52 right
00:05:41
so um and then we're going to say this
00:05:44
is required right because the API
00:05:46
requires this so the description here is
00:05:48
a little bit tricky because no one is
00:05:49
going to uh you know enter the uh
00:05:51
latitude and longitude into the into a
00:05:54
chat window right so what's what we're
00:05:55
going to say is this uh I'm going to say
00:05:58
um I would to say
00:06:00
location uh location
00:06:03
of the
00:06:04
weather I would say
00:06:07
latitude of the location right and then
00:06:10
I'm going to say um convert location to
00:06:15
Latitude right so that's one and the
00:06:17
next part is longitude longitude right
00:06:20
so I I got a quy over here and I got a
00:06:23
string over here the key is longitude
00:06:25
longitude and that's
00:06:28
13.41% go out of the earth so I'm going
00:06:31
to copy exactly the same thing and then
00:06:33
for descriptions I'm going to uh repeat
00:06:36
this this is going to be the longitude
00:06:38
of the location conver the location to
00:06:39
longitude over here and then this is
00:06:41
required right now we have a sample this
00:06:43
API and I'm going to we uh C head
00:06:47
already
00:06:48
has um CAD already has this uh down
00:06:53
right assemble and I'm going to um run
00:06:55
run the test right so this looks a
00:06:57
little bit weird to me but we'll see
00:07:00
what happens right so I'm going to
00:07:01
submit and this says okay invited the
00:07:04
time zone so right America Los Angeles
00:07:06
this feels weird right so let's see um
00:07:10
so originally I used this right so I
00:07:12
would just say okay let me ask a Gemini
00:07:15
so um what does uh this stand
00:07:19
for stand for um in ASA
00:07:23
format
00:07:25
uh kind computer science term oh okay
00:07:28
the slash character okay all right so
00:07:30
let's go back here and then I'll just
00:07:33
take replace America with Los Angeles I
00:07:35
have this URL assembled and then we're
00:07:37
going to test this again okay great yeah
00:07:39
so I have this and then I return at 200
00:07:42
and that's probably exactly the same
00:07:44
kind of response uh um um drawn over
00:07:48
here right so now I'm going to save
00:07:52
this and I go back we'll say okay this
00:07:55
API actually has the weather API right
00:07:57
so I'm going to uh go back to my
00:08:00
my dog and a fox pictures and then say
00:08:03
uh I would say okay what's the weather
00:08:06
what's the weather of Seattle right uh
00:08:10
today right
00:08:11
so send a message over here and then
00:08:15
let's say um oh okay oh that's kind of
00:08:18
cool um it's November the the 13th so
00:08:22
presumably the temperature okay it's
00:08:23
still like in in U uh in Celsius right
00:08:27
not in Fahrenheit 80 to 11 degree
00:08:29
throughout the day this is a high uh
00:08:32
probability of rain especially in the
00:08:33
early morning and late evenings uh we
00:08:35
expect rainfall of this right actually
00:08:37
it's kind of raining outside right so
00:08:39
that's yeah that's cool right so uh and
00:08:41
then let's ask what's the weather of
00:08:45
Seattle what's the the weather of uh
00:08:47
Chicago right Chicago uh
00:08:52
today
00:08:54
um oh Chicago is a a little bit a um a
00:08:58
wider range since that's not by the
00:09:00
ocean right so uh significant chance of
00:09:03
rain especially in the afternoon and
00:09:04
evening right so um um since you know we
00:09:07
remember we cat this API result I can
00:09:09
ask more question right so I would say
00:09:11
uh uh is it uh going to rain R uh today
00:09:17
in Seattle and
00:09:20
Chicago right so let's say U what the
00:09:22
API whether CH gbt actually caches the
00:09:26
result right so so is it is actually
00:09:28
expected to rent today in both Seattle
00:09:30
and Chicago right so okay let's just
00:09:32
uh uh say a double check right so I I
00:09:35
would to do um I would do Seattle
00:09:38
weather uh weather
00:09:41
today and uh oh okay actually it is
00:09:44
raining right 95% of a chance of reading
00:09:47
and then if I do a
00:09:48
Chicago uh
00:09:50
weather and I get U uh 69% of ring ring
00:09:55
chance and then by 900 p.m. it's 97%
00:09:58
right so that's actually pretty good if
00:10:00
you look at a Fahrenheit over here so
00:10:02
current currently it's 11° celsus uh
00:10:06
today right so this looks a pretty I
00:10:09
don't know uh maybe pretty accurate so
00:10:11
so we'll see right so so one trick thing
00:10:14
that we did was that converting the
00:10:16
longitude and attitude uh from Seattle
00:10:19
to Chicago I'm I'm sorry from Chicago
00:10:22
I'm sorry let me put it this again from
00:10:24
the location to Chicago right so um what
00:10:27
we're going to do is um um let's say um
00:10:31
I'll just uh I'll just enable um uh
00:10:35
what's the I'll just enable this right I
00:10:38
enable debug over here and then we're
00:10:40
going to ask uh let's do this a new uh
00:10:43
new chat what's this weather Chicago
00:10:45
today right we're going to observe the
00:10:48
API out outputs uh through the debug
00:10:51
mode right so this is actually this is
00:10:53
actually my response from C chat right
00:10:56
from 5 to 12 degrees over here and let's
00:10:59
see the API call the API call here is
00:11:02
that the latitude of 41 degrees and
00:11:05
longitude is minus 87 degrees right so
00:11:07
we don't really know and let's just uh
00:11:10
uh give it a try right so I'll go to
00:11:12
Google
00:11:14
Maps and I'm going to
00:11:17
assemble uh I'm going to assemble this
00:11:20
two locations let's make this one bigger
00:11:22
for you
00:11:24
and
00:11:27
um let's say what do the is really
00:11:30
really Chicago right so Google Maps
00:11:33
promps me with this and oh where is this
00:11:37
oh it is it is in it is in Chicago right
00:11:41
so uh cad actually finds out uh oh a
00:11:45
very heart of Chicago right uh the
00:11:47
longitude and the ltitude of latitude
00:11:50
and longitude of Chicago and then
00:11:52
automatically replace this right this is
00:11:54
all due to uh this uh description right
00:11:59
this this an instruction over here right
00:12:01
so uh I said convert the location to
00:12:04
Latitude uh and uh this is the location
00:12:07
or latitude right and convert the
00:12:09
location to longitude and then we'll get
00:12:10
we we get we get all of this right so
00:12:13
great this this actually works and this
00:12:15
has been the four tutorial of using the
00:12:17
advanced mode of customer GPD tool where
00:12:20
uh you can uh assemble a complex query
00:12:23
over here and then get some WEA
00:12:25
information by using um uh cchat but
00:12:29
thank you very much for watching and
00:12:30
then I'll stay tuned uh and see you in
00:12:33
the next tutorial thank you