AnanthulaShravya commited on
Commit
b84bbf4
·
verified ·
1 Parent(s): bebb2d9

Upload 5 files

Browse files
article_evaluator.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Agent
2
+ from llms.gpt import llm
3
+ from tools.helpers import streamlit_callback
4
+ from tools.scrape_website import scrape_tool
5
+
6
+ article_evaluator = Agent(
7
+ role="Recommended Article Evaluator",
8
+ goal="Verify if the articles suggested for the user align with his "
9
+ "interests or the articles he has read in the past. The artiles should "
10
+ "provide incremental learning to the user.",
11
+ verbose=True,
12
+ backstory=(
13
+ "You are a Recommended Article Evaluator, you are strict in your evaluation. "
14
+ "You evaluate articles based on the user's learning profile. "
15
+ "The articles you approve spark the interests in the user and the user has "
16
+ "incremental learning once the user completes reading the articles."
17
+ ),
18
+ allow_delegation=False,
19
+ llm=llm,
20
+ tools=[scrape_tool],
21
+ step_callback=streamlit_callback
22
+ )
article_suggestion.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Crew
2
+ from llms.gpt import llm
3
+ from agents.learning_profiler import learning_profiler
4
+ from agents.learning_curator import learning_curator
5
+ from agents.article_evaluator import article_evaluator
6
+ from agents.curiosity_catalyst import curiosity_catalyst
7
+ from tasks.create_learning_profile import learning_profile_task
8
+ from tasks.new_article_suggestion import article_suggestion_task
9
+ from tasks.evaluate_articles import evaluation_task
10
+ from tasks.create_article_pitch import article_pitch_task
11
+
12
+ article_recommendation_crew = Crew(
13
+ agents=[learning_profiler, learning_curator,
14
+ article_evaluator, curiosity_catalyst],
15
+ tasks=[learning_profile_task, article_suggestion_task,
16
+ evaluation_task, article_pitch_task],
17
+ verbose=True,
18
+ # memory=True,
19
+ manager_llm=llm,
20
+ embedder={
21
+ "provider": "openai",
22
+ "config": {
23
+ "model": 'text-embedding-3-small'
24
+ }
25
+ }
26
+ )
curiosity_catalyst.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Agent
2
+ from llms.gpt import llm
3
+ from tools.helpers import streamlit_callback
4
+ from tools.scrape_website import scrape_tool
5
+
6
+ curiosity_catalyst = Agent(
7
+ role="Curiosity Catalyst",
8
+ goal="To pique the user's curiosity to read the article.",
9
+ verbose=True,
10
+ tools=[scrape_tool],
11
+ backstory=(
12
+ "As a Curiosity Catalyst, you know exactly how to pique the user's curiosity "
13
+ "for reading the articles."
14
+ ),
15
+ allow_delegation=False,
16
+ llm=llm,
17
+ step_callback=streamlit_callback
18
+ )
learning_curator.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Agent
2
+ from llms.gpt import llm
3
+ from tools.helpers import streamlit_callback
4
+ from tools.scrape_website import scrape_tool
5
+ from tools.search_web import search_tool
6
+
7
+ learning_curator = Agent(
8
+ role="Personal Learning Curator",
9
+ goal="Make sure you present 5 articles on the topics that the user is interested in, "
10
+ "the article should provide the user with an incremental learning.",
11
+ verbose=True,
12
+ backstory=(
13
+ "As an Learning Strategist, the articles you suggest motivate and "
14
+ "provide incremental learning for the user."
15
+ ),
16
+ allow_delegation=False,
17
+ tools=[scrape_tool, search_tool],
18
+ llm=llm,
19
+ step_callback=streamlit_callback
20
+ )
learning_profiler.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Agent
2
+ from llms.gpt import llm
3
+ from tools.helpers import streamlit_callback
4
+ from tools.scrape_website import scrape_tool
5
+
6
+ learning_profiler = Agent(
7
+ role="Personal Learning Profiler",
8
+ goal="Make sure to create an excellent learning profile of the user based on his interests and previous reading history.",
9
+ verbose=True,
10
+ backstory=(
11
+ "As a Personal Learning Profiler, you excel at building a learning profile of a user. "
12
+ "The profile you build gives a high level overview of what interests that the user has. "
13
+ ),
14
+ allow_delegation=False,
15
+ llm=llm,
16
+ step_callback=streamlit_callback
17
+ )