Prathamesh1420
commited on
Update agents.py
Browse files
agents.py
CHANGED
@@ -1,43 +1,47 @@
|
|
1 |
-
from crewai import Agent
|
2 |
-
from tools import yt_tool
|
3 |
-
|
4 |
-
from dotenv import load_dotenv
|
5 |
-
|
6 |
-
load_dotenv()
|
7 |
-
|
8 |
-
import os
|
9 |
-
|
10 |
-
os.
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
43 |
)
|
|
|
1 |
+
from crewai import Agent
|
2 |
+
from tools import yt_tool
|
3 |
+
|
4 |
+
from dotenv import load_dotenv
|
5 |
+
|
6 |
+
load_dotenv()
|
7 |
+
|
8 |
+
import os
|
9 |
+
llm = ChatGoogleGenerativeAI(
|
10 |
+
api_key=os.getenv('GOOGLE_API_KEY'),
|
11 |
+
model="models/gemini-pro" # Replace with the correct model name
|
12 |
+
)
|
13 |
+
|
14 |
+
|
15 |
+
## Create a senior blog content researcher
|
16 |
+
|
17 |
+
blog_researcher=Agent(
|
18 |
+
role='Blog Researcher from Youtube Videos',
|
19 |
+
goal='get the relevant video transcription for the topic {topic} from the provided Yt channel',
|
20 |
+
verboe=True,
|
21 |
+
memory=True,
|
22 |
+
backstory=(
|
23 |
+
"Expert in understanding videos in AI Data Science , MAchine Learning And GEN AI and providing suggestion"
|
24 |
+
),
|
25 |
+
llm=llm,
|
26 |
+
tools=[yt_tool],
|
27 |
+
allow_delegation=True
|
28 |
+
)
|
29 |
+
|
30 |
+
## creating a senior blog writer agent with YT tool
|
31 |
+
|
32 |
+
blog_writer=Agent(
|
33 |
+
role='Blog Writer',
|
34 |
+
goal='Narrate compelling tech stories about the video {topic} from YT video',
|
35 |
+
verbose=True,
|
36 |
+
memory=True,
|
37 |
+
backstory=(
|
38 |
+
"With a flair for simplifying complex topics, you craft"
|
39 |
+
"engaging narratives that captivate and educate, bringing new"
|
40 |
+
"discoveries to light in an accessible manner."
|
41 |
+
),
|
42 |
+
llm=llm,
|
43 |
+
tools=[yt_tool],
|
44 |
+
allow_delegation=False
|
45 |
+
|
46 |
+
|
47 |
)
|