Spaces:
Running
Running
Update agents.py
Browse files
agents.py
CHANGED
@@ -4,62 +4,57 @@ from crewai_tools import ScrapeWebsiteTool, SerperDevTool
|
|
4 |
scrape_tool = ScrapeWebsiteTool()
|
5 |
search_tool = SerperDevTool()
|
6 |
|
7 |
-
def
|
8 |
return Agent(
|
9 |
-
role="
|
10 |
-
goal="
|
11 |
-
|
12 |
-
|
13 |
-
"
|
14 |
-
"
|
15 |
-
"
|
16 |
-
"
|
17 |
-
|
18 |
-
allow_delegation=
|
19 |
-
|
20 |
)
|
21 |
|
22 |
-
def
|
23 |
return Agent(
|
24 |
-
role="
|
25 |
-
goal="
|
26 |
-
"
|
27 |
-
backstory="
|
28 |
-
"
|
29 |
-
"
|
30 |
-
"the
|
31 |
-
"
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
)
|
36 |
|
37 |
-
def
|
38 |
return Agent(
|
39 |
-
role="
|
40 |
-
goal="
|
41 |
-
"
|
42 |
-
backstory="
|
43 |
-
"
|
44 |
-
"
|
45 |
-
"
|
46 |
-
"
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
def get_risk_management_agent():
|
53 |
-
return Agent(
|
54 |
-
role="Risk Advisor",
|
55 |
-
goal="Evaluate and provide insights on the risks "
|
56 |
-
"associated with potential trading activities.",
|
57 |
-
backstory="Armed with a deep understanding of risk assessment models "
|
58 |
-
"and market dynamics, this agent scrutinizes the potential "
|
59 |
-
"risks of proposed trades. It offers a detailed analysis of "
|
60 |
-
"risk exposure and suggests safeguards to ensure that "
|
61 |
-
"trading activities align with the firm’s risk tolerance.",
|
62 |
-
verbose=True,
|
63 |
-
allow_delegation=True,
|
64 |
-
tools = [scrape_tool, search_tool]
|
65 |
)
|
|
|
4 |
scrape_tool = ScrapeWebsiteTool()
|
5 |
search_tool = SerperDevTool()
|
6 |
|
7 |
+
def get_content_planner():
|
8 |
return Agent(
|
9 |
+
role="Content Planner",
|
10 |
+
goal="Plan engaging and factually accurate content on {topic}",
|
11 |
+
backstory="You're working on planning a blog article "
|
12 |
+
"about the topic: {topic}."
|
13 |
+
"You collect information that helps the "
|
14 |
+
"audience learn something "
|
15 |
+
"and make informed decisions. "
|
16 |
+
"Your work is the basis for "
|
17 |
+
"the Content Writer to write an article on this topic.",
|
18 |
+
allow_delegation=False,
|
19 |
+
verbose=True
|
20 |
)
|
21 |
|
22 |
+
def get_content_writer():
|
23 |
return Agent(
|
24 |
+
role="Content Writer",
|
25 |
+
goal="Write insightful and factually accurate "
|
26 |
+
"opinion piece about the topic: {topic}",
|
27 |
+
backstory="You're working on a writing "
|
28 |
+
"a new opinion piece about the topic: {topic}. "
|
29 |
+
"You base your writing on the work of "
|
30 |
+
"the Content Planner, who provides an outline "
|
31 |
+
"and relevant context about the topic. "
|
32 |
+
"You follow the main objectives and "
|
33 |
+
"direction of the outline, "
|
34 |
+
"as provide by the Content Planner. "
|
35 |
+
"You also provide objective and impartial insights "
|
36 |
+
"and back them up with information "
|
37 |
+
"provide by the Content Planner. "
|
38 |
+
"You acknowledge in your opinion piece "
|
39 |
+
"when your statements are opinions "
|
40 |
+
"as opposed to objective statements.",
|
41 |
+
allow_delegation=False,
|
42 |
+
verbose=True
|
43 |
)
|
44 |
|
45 |
+
def get_editor():
|
46 |
return Agent(
|
47 |
+
role="Editor",
|
48 |
+
goal="Edit a given blog post to align with "
|
49 |
+
"the writing style of the organization. ",
|
50 |
+
backstory="You are an editor who receives a blog post "
|
51 |
+
"from the Content Writer. "
|
52 |
+
"Your goal is to review the blog post "
|
53 |
+
"to ensure that it follows journalistic best practices,"
|
54 |
+
"provides balanced viewpoints "
|
55 |
+
"when providing opinions or assertions, "
|
56 |
+
"and also avoids major controversial topics "
|
57 |
+
"or opinions when possible.",
|
58 |
+
allow_delegation=False,
|
59 |
+
verbose=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
)
|