Prathamesh1420 commited on
Commit
168fda2
·
verified ·
1 Parent(s): 4f01e45

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +46 -42
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
- os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
10
- os.environ["OPENAI_MODEL_NAME"]="gpt-4-0125-preview"
11
-
12
-
13
- ## Create a senior blog content researcher
14
-
15
- blog_researcher=Agent(
16
- role='Blog Researcher from Youtube Videos',
17
- goal='get the relevant video transcription for the topic {topic} from the provided Yt channel',
18
- verboe=True,
19
- memory=True,
20
- backstory=(
21
- "Expert in understanding videos in AI Data Science , MAchine Learning And GEN AI and providing suggestion"
22
- ),
23
- tools=[yt_tool],
24
- allow_delegation=True
25
- )
26
-
27
- ## creating a senior blog writer agent with YT tool
28
-
29
- blog_writer=Agent(
30
- role='Blog Writer',
31
- goal='Narrate compelling tech stories about the video {topic} from YT video',
32
- verbose=True,
33
- memory=True,
34
- backstory=(
35
- "With a flair for simplifying complex topics, you craft"
36
- "engaging narratives that captivate and educate, bringing new"
37
- "discoveries to light in an accessible manner."
38
- ),
39
- tools=[yt_tool],
40
- allow_delegation=False
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
  )