0% found this document useful (0 votes)
102 views

AutoGen Studio 2.0 Tutorial

Uploaded by

Tchad Carby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

AutoGen Studio 2.0 Tutorial

Uploaded by

Tchad Carby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Search in video

0:00
we have a brand new version of autogen
0:02
Studio that just dropped it has new
0:04
features expanded functionality and
0:07
we're going to build something for the
0:08
real world and this video is going to be
0:10
a little different I haven't built this
0:12
agent team myself yet so you're going to
0:14
build it with me and you're going to see
0:15
my mistakes let's get into it the team
0:18
we're going to be building today is
0:19
going to take a YouTube url grab the
0:21
transcript for it and then convert that
0:23
transcript into a compelling blog post
0:26
and a tweet thread this is something
0:28
that I need it's a real world use case
0:30
and we're going to build it together all
0:31
right so the first thing we're going to
0:32
do is install autogen Studio from
0:35
scratch now I had an older version of
0:37
autogen studio and then when I went to
0:39
upgrade to the newer version of autogen
0:41
Studio everything broke and I kept
0:43
getting all these database issues and
0:45
errors and it was just a nightmare and
0:47
what finally fixed it was uninstalling
0:50
autogen studio with this command pip
0:52
uninstall autogen studio and not only
0:55
that I actually had to go into my python
0:57
site packages and manually delete the
0:59
auto gen Studio folders so if you run
1:01
into any issues while upgrading to the
1:03
new autogen studio be sure to do that
1:05
and I already made a beginner tutorial
1:07
about autogen Studio I'll drop a link to
1:09
that in the description below so the
1:11
first thing we're going to do is create
1:12
a new cond environment condac create DN
1:15
AG python equal 3.11 hit enter so I
1:18
already have an existing environment we
1:20
are going to remove it and then accept
1:22
we're going to install everything we
1:23
need then we're going to grab this
1:25
Command right here cond to activate AG
1:27
paste it in hit enter and now we know
1:29
the environment is active because it's
1:31
right there next we're going to install
1:32
autogen studio and this is super simple
1:35
pip install autogen Studio then just hit
1:38
enter now once you're done with that
1:39
we're going to run autogen Studio ui--
1:42
Port 8081 and you can specify any port
1:45
you want sometimes if you close autogen
1:48
studio in the wrong way it'll say this
1:50
port is busy and then you just change it
1:52
to 882 or 883 or anything that you want
1:55
so I'm going to hit enter on 881 and
1:57
there is that issue so I closed down
1:59
Port 8 881 in the wrong way last time so
2:01
here is the error that you will see so
2:03
we're going to change that to 882 now
2:05
and now it works I'm going to hold down
2:07
command and I'm going to click on this
2:09
URL to open up local host in my browser
2:11
all right and here it is the newest
2:12
version of autogen studio so what is
2:15
different about it if you go to the
2:17
build tab you'll see we have new tabs
2:20
over here for one we have this models
2:22
tab now you can predefine different
2:25
models to use with your agents and you
2:27
can mix and match as you want you can
2:29
have specific specific models tailored
2:31
for specific agent use cases it is
2:33
brilliant so here you can see we have
2:35
GPT 4 GPT 4 preview and the BLS Zephyr
2:38
7B Alpha if you wanted to add a new
2:41
model we'll go do that right there but
2:42
we don't need to do that we're going to
2:44
be using chat GPT 4 today and we're
2:46
going to actually be using this preview
2:47
version the other thing that's new and
2:50
I'll get to it in a second is the fact
2:51
that you can have agent teams greater
2:54
than just two agents in the previous
2:56
version you could only have two agents a
2:58
sender and a receiver now you can have
3:00
agent groups where you can group
3:02
together multiple agents in addition to
3:05
your user proxy now I haven't tested
3:07
this yet I'm hoping it works but if it
3:10
doesn't you're going to see it so switch
3:11
over to open AI if you don't already
3:13
have an account go ahead and sign up
3:15
come to the API Keys section we're going
3:17
to create a new key I'm going to call it
3:19
autogen studio hit
3:23
enter and it's asking me to verify that
3:25
I'm a human so this is something I'd
3:27
usually cut out of the video use the
3:29
eror to rotate the object to face in the
3:31
direction of the hand interesting all
3:34
right verification complete all right
3:36
now I'm going to copy this yes I am
3:37
going to revoke this API key before
3:39
publishing the video I know you all are
3:41
sick of hearing me say that but if I
3:43
don't I get a bunch of comments about
3:45
not showing my API key so we'll come
3:47
back to autogen Studio we're going to
3:50
click on this model right here and then
3:52
we're going to enter our API key I don't
3:54
believe we need to do anything else for
3:55
GPT 4 everything else should stay the
3:58
same because the chat GPT T API is the
4:00
default then we'll hit enter model
4:02
created successfully now the first thing
4:05
we want to do is create a skill and the
4:08
skill that I need created today is a
4:10
function to go grab the transcript from
4:13
a YouTube video now how would I go about
4:16
writing that I'm actually going to use
4:17
chat GPT to write it for me now just to
4:20
make sure it is in the format that is
4:22
similar to something I already know
4:24
works I clicked over to the skills tab
4:26
I'm looking at this fetch profile skill
4:29
clicking into it and this is pretty
4:31
similar where you pass in a URL and it
4:33
goes and gets something so this is
4:35
probably what I'm going to want to do
4:37
something similar to so I'm going to go
4:39
ahead and copy it I switched over to
4:41
chat GPT I'm going to paste it in and
4:44
then under it I'm going to say here's an
4:46
example script make something similar to
4:48
this but instead make it accept a
4:50
YouTube url as a parameter it goes and
4:53
gets the transcript from the URL via the
4:55
YouTube API and then Returns the
4:57
transcript let's see what we get okay so
4:59
it looks like this method is going to
5:01
accept a video URL so that's right so
5:03
far giving me some documentation that's
5:05
fine it's going to extract the video ID
5:08
from the URL that looks good okay and
5:10
it's going to use the Google api's
5:13
YouTube API so hopefully this works
5:15
we'll see we might need to iterate on
5:17
this if it doesn't work I've seen
5:18
another method written for this exact
5:20
use case to go grab the transcript and
5:22
it was a little bit different from this
5:24
so I don't know if it's going to work
5:25
okay so this one says the YouTube data
5:27
API requires an API key which you can
5:30
obtain from the Google Cloud console so
5:32
this is different I don't want to have
5:34
to do that let's try again show me
5:36
another way to do it that doesn't
5:38
require an API key there should be a
5:40
YouTube API that you can hit directly
5:43
okay and this looks more akin to what I
5:45
saw when I did it last time so it's
5:47
using this Library called YouTube
5:50
transcript API and hopefully it's able
5:53
to do it just with that and it says I
5:55
need to install the YouTube transcript
5:57
API with Pip but I'm going to try it
5:59
without that that so I'm going to go
6:00
ahead and copy the code and I believe
6:02
autogen Studio when I paste this in will
6:05
automatically know that it needs to
6:07
install that Library so I copied it
6:09
switch back to autogen Studio we're
6:11
going to create a new skill I'm going to
6:13
call it fetch YouTube transcript I'm
6:15
going to take what's in here which is a
6:16
sample I'm going to delete it then I'm
6:17
going to paste in what I just had it has
6:19
an example of how to use it at the
6:21
bottom I might as well leave that in and
6:23
then I'm going to hit okay so that's
6:25
done so now we have our model and our
6:27
skill created now let's create an agent
6:30
we have our primary assistant and our
6:32
user proxy but I want to create an agent
6:35
team and the Agents that I want are one
6:38
I want an agent to go and get the
6:39
YouTube transcript and remove the
6:41
timestamps and then return it the second
6:43
agent I want is to take that text and
6:46
then convert it into a blog post and
6:48
into a Twitter thread let's see if we
6:51
can do that so I'm going to click new
6:52
agent the agent name I'm going to call
6:54
it transcript getter for the description
6:57
takes a YouTube URL and gets the
6:59
transcript from a video I'm going to say
7:01
Max consecutive auto reply just leave it
7:03
as the default human input mode never
7:06
and then the system message this is
7:08
where I believe we need to actually tell
7:10
it which tool to use you are an AI agent
7:13
that uses the fetch YouTube transcript
7:15
skill to get a YouTube transcript for
7:18
subsequent processing we're going to be
7:19
using this model now if you wanted to
7:21
add a different model you do so right
7:23
here now here for the skills this is
7:25
where we need to add our skill so I go
7:27
ahead and click plus here we go fetch
7:29
YouTube transcript I'm going to go and
7:32
say add skill and there it is then I
7:35
click okay so now we have our transcript
7:37
getter then let's create our second
7:39
agent and this one is going to be
7:41
content writer takes raw YouTube video
7:44
transcripts and converts it into blog
7:46
posts and tweet threads Max consecutive
7:48
auto reply stays the same human input
7:50
mode never now for the system message
7:53
you are an insightful intelligent and
7:55
witty content writer who is able to take
7:57
raw YouTube video transcripts and turn
7:59
them into blog posts and tweet threads
8:01
we do not need a skill for this guy and
8:03
we're going to leave the model the same
8:04
as before so now we have our two agents
8:07
right there now the last thing we need
8:09
to do is create a workflow so we'll
8:11
click over to workflows and we're going
8:12
to click new workflow now this is
8:14
something new previously when you
8:16
clicked workflow it just automatically
8:18
opened up and you can only have two
8:20
agents now you can have two agents and
8:22
you can also do this thing called group
8:24
chat so we're going to use group chat
8:25
because we're going to have three agents
8:27
the content writer the YouTube scraper
8:30
and then the user proxy so we're going
8:32
to hit group chat we're going to call
8:34
this YT script to content workflow
8:37
description so we're going to say takes
8:39
a YouTube url gets the transcript of the
8:42
video and then creates a blog post and
8:44
tweet thread from that transcript
8:46
summary method we're going to leave as
8:47
last which is the default the sender is
8:49
going to be the user proxy and then the
8:52
receiver is going to be the group chat
8:53
assistant but we need to fill out the
8:56
group chat assistant so go ahead click
8:58
into it now we we have two primary
9:00
assistants here so I'm going to go ahead
9:02
and delete both of those and we're going
9:03
to add the content writer and the
9:06
transcript getter I'm going to keep it
9:08
the same name I'm going to leave the
9:10
description default and then for the
9:11
system message I'm going to be very
9:13
descriptive okay I'm being very explicit
9:16
here I actually don't know if you need
9:17
to be That explicit in the system
9:19
message cuz typically a system message
9:21
you're just setting up the role you're
9:22
telling the agent who to behave as not
9:25
necessarily describing what you want
9:27
them to do which we will likely do again
9:29
when we actually submit the prompt you
9:31
are a helpful assistant skilled at okay
9:33
coordinating spelled wrong coordinating
9:35
a group of other assistants to solve a
9:37
task the task you will solve is taking a
9:40
YouTube url having an agent use the
9:42
fetch YouTube transcript skill to get
9:44
the transcript from the YouTube video
9:46
pass that transcript to a Content writer
9:49
and then having the content writer
9:50
create a blog post and tweet thread
9:52
based on that transcript now it's
9:54
interesting the group chat manager also
9:56
can take a skill and I don't think we
9:59
need to give it a skill because the
10:01
agent itself has the skill we'll find
10:04
out ah and here's a bug that I've
10:05
noticed so if you remember I I removed
10:09
these primary assistants and I added
10:11
other assistants but when I start typing
10:13
it reverts back to these primary
10:15
assistance so remember fill out
10:17
everything first and then modify your
10:19
group agents so I'm going to delete
10:20
these again and I'm going to add the
10:22
content writer back and the transcript
10:24
getter and then we're going to hit okay
10:26
and okay again let's double check that
10:28
it actually does have the correct agent
10:30
so I'm going to click here click there
10:33
and it does perfect okay so now we're
10:34
going to get out of here and let's test
10:37
it out I hope it works we're going to go
10:39
to the playground we're going to click
10:41
new session and we're going to select YT
10:43
script to content and then hit create so
10:46
here we go take this YouTube URL and I
10:48
paste it in one of my YouTube videos use
10:51
the fetch YouTube transcript skill to
10:53
get the transcript from the YouTube
10:54
video remove the timestamps if any then
10:57
create a blog post and tweet thread
10:59
based on that transcript now the one
11:02
thing that's kind of difficult about
11:04
autogen is it doesn't have explicit
11:06
delegation options I can't explicitly
11:09
say this group chat agent should
11:11
delegate to the content writer or the
11:13
YouTube transcript getter you can't do
11:15
that and I think we just have to be
11:17
extra explicit in our descriptions to
11:19
get it to work that way all right enough
11:21
talk let's see what
11:25
happens okay so we got an error and it
11:28
says that the API key is not there which
11:31
is interesting so I'm going to go back
11:32
to build I'm going to go to models here
11:34
it is and it is there let me see what
11:37
that message is one more time so I click
11:39
here and I'm just going to say retry so
11:42
the API client option must be either set
11:44
by passing environment variable okay
11:47
that's weird I don't understand why I
11:50
have to set the environment variable
11:51
since I have it set in the model right
11:53
there but that's okay we're going to do
11:55
it anyways so I'm going to switch back
11:57
to the terminal going to go go to a new
11:59
tab and I'm going to type then I'm going
12:01
to do cond to activate AG then I'm going
12:04
to type export open AI API key and then
12:06
equals and then the API key and then hit
12:09
enter okay so it should be done now I
12:11
think I have to restart autogen studio
12:13
so I'm going to do that so I come here
12:15
and I'm going to click contrl C okay now
12:18
we're going to restart it there it is
12:20
going to go back to autogen studio now
12:22
going to refresh the page going to go to
12:24
playground and let's click retry nope
12:28
let's try that again I'm going to quit
12:30
out of here again and I'm going to do
12:32
export then the API key one more time
12:34
and then we'll start it up and let's
12:37
refresh the page and let's see if it
12:39
worked that time it did okay so for some
12:42
reason going into a new tab made it so
12:44
that it didn't actually see the API key
12:47
which is weird so just keep that in mind
12:49
if you run into that issue now we can
12:51
tell it's working because we can see
12:52
these three dots bouncing right there so
12:54
switching over to the terminal I can
12:56
actually see the code and the back and
12:58
forth between the agents as it's going
13:00
so it is saying yes use the fetch
13:03
YouTube transcript skill so that's good
13:05
and it does know to install the YouTube
13:07
transcript API now one thing to note is
13:10
that in autogen it doesn't actually show
13:12
you the back and forth conversation I do
13:14
know that there's an open ticket to make
13:16
it do that so you don't have to look at
13:18
the terminal while it's going but here
13:19
it is so there it got the YouTube
13:21
transcript that's perfect okay it's done
13:24
look at that all right so here it is
13:28
let's take a look look at what we got so
13:29
here's the code output okay we got all
13:31
that that's great let's look at the
13:33
actual agent messages so the user proxy
13:35
says take this URL so that's me typing
13:38
take the URL use the fetch YouTube
13:39
transcript skill get the transcript
13:41
remove the timestamps create a blog post
13:43
and a tweet thread then the transcript
13:46
getter to the content writer is actually
13:48
saying to accomplish this task we will
13:50
follow these steps so the transcript
13:52
getter is actually planning out what we
13:54
need to do the transcript getter also
13:56
installed everything we needed writes a
13:58
p python script to use that skill that
14:00
we gave it and then here it is so here
14:02
is the actual transcript from the video
14:05
and then interestingly it didn't give us
14:07
anything after that so it didn't
14:09
actually output it okay so interesting
14:11
for some reason it didn't actually
14:13
output the final blog post and tweet
14:16
thread in the UI itself however if I
14:19
switch over to terminal here it is
14:20
here's a suggested structure for the
14:22
blog post and then it actually writes
14:25
the blog post and this is pretty good
14:27
and then we have a tweet thread so
14:29
here's tweet one tweet two uses emojis
14:32
uses hashtags I mean this is great now
14:34
the one thing I don't understand is why
14:36
it didn't actually output that
14:37
information into here but I don't think
14:39
I'm going to be able to solve that in
14:40
this video we do know it worked though
14:43
so that's it now you know how to use the
14:45
new version of autogen Studio you know
14:47
how to create a skill for your agents to
14:48
use you know how to assign that skill to
14:51
the right agent you know how to create
14:52
the agent team and you know how to
14:54
execute the task and it did so pretty
14:57
darn well I'm happy with this result if
14:59
you want to see me create more of these
15:01
tutorials with real world use cases let
15:04
me know in the comments below if you
15:06
enjoyed this video please consider
15:07
giving a like And subscribe and I'll see
15:09
you in the next one

You might also like